bastinald / laravel-livewire-modals

Dynamic Laravel Livewire Bootstrap modals.
66 stars 31 forks source link

Not working #1

Closed pishguy closed 3 years ago

pishguy commented 3 years ago

after many checking the package readme as how can i install and use it into laravel. after installing the package and adding some code into project like with what we see in read me, clicking on button doesn't show any modal

bastinald commented 3 years ago

Copy and paste your code here.

pishguy commented 3 years ago

app.js:

require('./bootstrap');
require('../../vendor/bastinald/laravel-livewire-modals/js/modals');

user-profile-component.blade.php blade file:

<button type="button"
        wire:click="$emit('showModal', 'profile-update')">
    {{ __('Update Profile') }}
</button>

UserProfileComponent.php:

class UserProfileComponent extends Component
{
    public $title = 'Update Profile';
    public function render()
    {
        return view('user::livewire.user-profile-component');
    }
}

now when i click on button, modal should be appear

pishguy commented 3 years ago

@bastinald

each modal should be have a single component?

is any sample code?

bastinald commented 3 years ago

Look at the example here: https://github.com/bastinald/laravel-livewire-auth/blob/master/stubs/app/Http/Livewire/Auth/ProfileUpdate.php

In fact I recommend you start with that package if you're new.