PHP code example of azgasim / filament-unsaved-changes-modal

1. Go to this page and download the library: Download azgasim/filament-unsaved-changes-modal 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/ */

    

azgasim / filament-unsaved-changes-modal example snippets


use AzGasim\FilamentUnsavedChangesModal\FilamentUnsavedChangesModalPlugin;

return $panel
    // … your existing panel configuration …
    ->unsavedChangesAlerts()
    ->plugin(FilamentUnsavedChangesModalPlugin::make());

FilamentUnsavedChangesModalPlugin::make()
    ->modalWidth('xl')
    ->modalIcon('OutlinedExclamationTriangle')
    ->modalIconColor('danger')
    ->stayButtonColor('gray')
    ->leaveButtonColor('warning')
bash
php artisan vendor:publish --tag="filament-unsaved-changes-modal-translations"
bash
php artisan vendor:publish --tag="filament-unsaved-changes-modal-views"