aliqasemzadeh / livewire-bootstrap-modal

Dynamic Laravel Livewire Bootstrap modals.
35 stars 12 forks source link

Help to make it work #1

Closed B1G1 closed 1 year ago

B1G1 commented 2 years ago

Hi, my livewire component is views\livewire\modals\add-authotizations.blade.php

<div class="modal-dialog">
    <div class="modal-content">
    <div class="modal-header">
        <h5 class="modal-title">Modal title</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
    </div>
    <div class="modal-body">
        <p>Modal body text goes here.</p>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
    </div>
    </div>
</div>

in another view i inserted a button like this

<button class="btn btn-primary" type="button" wire:click="$emit('showModal', 'livewire.modals.add-authorizations')">
         {{ __('Aggiungi abilitazioni') }}
</button>

and the component class

<?php

namespace App\Http\Livewire\Modals;

use Livewire\Component;

class AddAuthorizations extends Component
{

    public function save()
    {  
        $this->emit('hideModal');
    }

    public function render()
    {
        return view('livewire.modals.add-authorizations');
    }
}

The modal is not shown. I use Jetstream with Jetstrap and laravel 9

Can you help me?

aliqasemzadeh commented 2 years ago

Can you give me you repo?

aliqasemzadeh commented 1 year ago

@B1G1 Did you build your assets?