PHP code example of dongrim / laravel-toastr

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

    

dongrim / laravel-toastr example snippets


// config/app.php

'providers' => [
  // ...
  Dongrim\Toastr\ToastrServiceProvider::class,
],

'aliases' => [
  // ...
  'Toastr' => Dongrim\Toastr\Facades\Toastr::class,
],



return [

    'session_name' => 'toastr',

    'options' => [
        "closeButton" => true,
        "debug" => false,
        "newestOnTop" => false,
        "progressBar" => true,
        "positionClass" => "toast-bottom-right",
        "preventDuplicates" => false,
        "onclick" => null,
        "showDuration" => "300",
        "hideDuration" => "1000",
        "timeOut" => "10000",
        "extendedTimeOut" => "1000",
        "showEasing" => "swing",
        "hideEasing" => "linear",
        "showMethod" => "fadeIn",
        "hideMethod" => "fadeOut"
    ]

];



namespace App\Http\Controllers;

use Illuminate\Http\Request;
use TJGazel\Toastr\Facades\Toastr;

class DashboardController extends Controller
{

    public function index()
    {
        Toastr::info('welcome admin!');

        return view('dashoard.index');
    }
}

toastr()
    ->error('Unauthorized!', 'Error 401')
    ->info('Authentication