PHP code example of khauto / sessionflashtoster

1. Go to this page and download the library: Download khauto/sessionflashtoster 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/ */

    

khauto / sessionflashtoster example snippets


return [
    'position'    => 'toast-top-right',
    'timeout'     => 4000,
    'progressBar' => true,
];

// In a controller
return redirect()->back()->with('success', 'Profile updated successfully!');

Route::get('/test-toaster', function () {
    return view('test-toaster');
});

Route::get('/notify/{type}', function ($type) {
    return redirect('/test-toaster')->with($type, ucfirst($type) . ' notification triggered!');
});
bash
php artisan vendor:publish --tag=sessionflashtoster-config

config/sessionflashtoster.php
bash
php artisan vendor:publish --tag=sessionflashtoster-views

resources/views/vendor/sessionflashtoster/scripts.blade.php