PHP code example of marius321967 / laravel-messages

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

    

marius321967 / laravel-messages example snippets


// Show message in current page
if ($error) {
    $store->add('Failed to perform operation', 'error');
}

// Show message in next page (flash)
if ($error) {
    $store->flash('Failed to perform operation', 'error');
}

@foreach (\marius321967\Messages\Facades\Message::getActiveMessages() as $message)
    <div class="message-{{ $message->type() }}">{{ $message->message() }}</div>
@endforeach