PHP code example of marjose / laravel-bootstrap-notify

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

    

marjose / laravel-bootstrap-notify example snippets


return [
    /*
    |--------------------------------------------------------------------------
    | Notification timeout
    |--------------------------------------------------------------------------
    |
    | Defines the number of seconds during which the notification will be visible.
    |
    */

    'timeout'   => 5000,
    
    /*
    |--------------------------------------------------------------------------
    | Preset Messages
    |--------------------------------------------------------------------------
    |
    | Define any preset messages here that can be reused.
    |
    */

    'preset-messages' => [
        // An example preset 'user updated' Connectify notification.
        'user-updated' => [
            'message' => 'The user has been updated successfully.',
            'type'    => 'success',
            'icon'    => 'fas fa-thumbs-up fa-3x',
            'model'   => null,
            'title'   => 'User Updated',
        ],
    ],
];


public function store()
{
    notify()->success('Laravel Notify is awesome!');

    return Redirect::home();
}

notify()->success($message);
notify()->error($message);
notify()->info($message);
notify()->warning($message);

'user-updated' => [
            'message' => 'The user has been updated successfully.',
            'type'    => 'success',
            'icon'    => 'fas fa-thumbs-up fa-3x',
            'model'   => null,
            'title'   => 'User Updated',
        ],

use Marjose\notify\notify;
notify::preset('user-updated');
bash
php artisan vendor:publish --provider="Marjose\notify\notifyServiceProvider" --tag="notify-assets"
bash
php artisan vendor:publish --provider="Marjose\notify\notifyServiceProvider" --tag="notify-views"
bash
php artisan vendor:publish --provider="Marjose\notify\notifyServiceProvider" --tag="notify-config"
bash
composer dump-autoload