PHP code example of bastinald / laravel-livewire-modals

1. Go to this page and download the library: Download bastinald/laravel-livewire-modals library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bastinald / laravel-livewire-modals example snippets


namespace App\Http\Livewire\Users;

use App\Models\User;
use Livewire\Component;

class Update extends Component
{
    public $user;
    
    public function mount(User $user)
    {
        $this->user = $user;
    }
    
    public function render()
    {
        return view('users.update');
    }
}

public function save()
{
    $this->validate();

    // save the record

    $this->emit('hideModal');
}
console
php artisan vendor:publish --tag=laravel-livewire-modals:views