PHP code example of gbuckingham89 / laraflash

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

    

gbuckingham89 / laraflash example snippets


composer 

Gbuckingham89\Laraflash\ServiceProvider::class

'Laraflash' => Gbuckingham89\Laraflash\Facade\Laraflash::class

php artisan vendor:publish --provider="Gbuckingham89\Laraflash\ServiceProvider"

Laraflash::flash("This is a flash message.", "success");

Laraflash::success("This is a success flash message.");

Laraflash::info("This is an info flash message.");

Laraflash::warning("This is a warning flash message.");

Laraflash::danger("This is a danger flash message.");

@

use Gbuckingham89\Laraflash\LaraflashAssertions;

LaraflashAssertions::assertResponseDoesntHaveLaraflash($response);

LaraflashAssertions::assertResponseHasLaraflash($response, 'info', 'The message you are expecting');

LaraflashAssertions::assertResponseHasLaraflashSuccess($response, 'The message you are expecting');
LaraflashAssertions::assertResponseHasLaraflashInfo($response, 'The message you are expecting');
LaraflashAssertions::assertResponseHasLaraflashWarning($response, 'The message you are expecting');
LaraflashAssertions::assertResponseHasLaraflashDanger($response, 'The message you are expecting');