PHP code example of tatter / alerts

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

    

tatter / alerts example snippets


foreach ($alerts as $alert) {
    [$class, $content] = $alert;

<body>
    <aside>
    {alerts}
    </aside>
    <main class="wrapper">
    ...

session()->setFlashdata('success', 'Your account has been updated.');

if (! $fruit = $this->getPost('fruit')) {
    return redirect()->back()->with('error', 'You must select a fruit!');
}

helper(['alerts']);
alert('error', 'You must accept the terms of service to continue.');

$_SESSION['debug'] = (string) $user->getCreditCard();

/** @var Notice $notice */
$notice = model(NoticeModel::class)->first();
session('notice', $notice);
...

// Later that same day...
alert('notice', 'Site statistics are currently being updated, expect longer load times.');