PHP code example of codemastersolucoes / flash-materialize

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

    

codemastersolucoes / flash-materialize example snippets


'providers' => [
    CodeMasterSolucoes\FlashMaterialize\FlashServiceProvider::class,
];

'colors' => [
        'info'    => [
            'message'   => [
                'background' => 'blue darken-2 font-weight-bold',
                'text'       =>  'white-text'
            ],
            'button' => [
                'background' => 'blue darken-2',
                'text'       => 'yellow-text'
            ],
        ],
        'success' => [
            'message' => [
                'background' => 'green',
                'text'       => 'white-text font-weight-bold'
            ],
            'button'  => [
                'background' => 'green',
                'text'       => 'white-text'
            ],
        ],
        'warning' => [
            'message' => [
                'background' => 'yellow darken-3',
                'text'       => 'black-text font-weight-bold'
            ],
            'button'  => [
                'background' => 'yellow darken-3',
                'text'       => 'red-text'
            ],
        ],
        'error'   => [
            'message' => [
                'background' => 'red',
                'text'       => 'white-text font-weight-bold'
            ],
            'button'  => [
                'background' => 'red',
                'text'       => 'white-text'
            ],
        ],
    ],

'views_path' => base_path('resources/views/vendor/flash-materialize'),

public function store()
{
    flash('Welcome Aboard!');

    return home();
}

public function info()
{
    flash()->info('Message Info');

    return home();
}

public function success()
{
    flash()->success('Message Success');

    return home();
}

public function warning()
{
    flash()->warning('Message Warning');

    return home();
}

public function error()
{
    flash()->error('Message Error');

    return home();
}

flash('Welcome Aboard!');

return home();

flash('Disappear in 30 seconds', 30000);

return home();

flash('Message 1');
flash('Message 2', 30000);

return redirect('somewhere');
bash
php artisan vendor:publish --provider="CodeMasterSolucoes\FlashMaterialize\FlashServiceProvider"