Closed pishguy closed 3 years ago
Copy and paste your code here.
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
@bastinald
each modal should be have a single component?
is any sample code?
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.
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