1. Go to this page and download the library: Download codezero/laravel-flash 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/ */
// use 'resources/views/custom.blade.php' instead of
// 'resources/views/vendor/flash/notifications/success.blade.php'
flash()->success('message')->setView('custom');
namespace App;
use CodeZero\Flash\BaseFlash;
class YourCustomFlash extends BaseFlash
{
/**
* Flash a notification.
*
* @param string $message
*
* @return \CodeZero\Flash\Notification
*/
public function danger($message)
{
return $this->notification($message, 'danger');
}
}
public function register()
{
$this->app->bind('flash', \App\YourCustomFlash::class);
}