1. Go to this page and download the library: Download albert-miyahira/flash-alert 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/ */
albert-miyahira / flash-alert example snippets
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+ use Illuminate\Support\Facades\Blade;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
+ Blade::component('vendor.flash_alert.flash_alert', 'flashAlert');
}
}
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function __construct()
{
+ parent::__construct();
}
~
~
<body>
+ @n" class="container">
~
~
->with([
config('flash_alert.TYPE_KEY') => 'primary | secondary | success | danger | warning | info | light | dark',
config('flash_alert.TITLE_KEY') => trans('flash_msg.flash_title.success'),
config('flash_alert.MSG_KEY') => 'msg',
// option
// use html tag config('flash_alert.MSG_KEY') => '<strong class="xxx">title</strong>',
config('flash_alert.TITLE_ESCAPE_KEY') => true,
// use html tag config('flash_alert.MSG_KEY') => '<a href="/">msg</a>',
config('flash_alert.MSG_ESCAPE_KEY') => true,
config('flash_alert.ALERT_CLASS_KEY') => 'primary | secondary | success | danger | warning | info | light | dark'
])