PHP code example of prajwal89 / lara-toast

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

    

prajwal89 / lara-toast example snippets


<!DOCTYPE html>
<html>
<head>
    @laraToastCSS
</head>
<body>
    @

// Success notification
laraToast()->success('Success!', 'Operation completed successfully');

// Info notification
laraToast()->info('Info', 'Here is some information');

// Danger notification
laraToast()->danger('Error!', 'Something went wrong');

laraToast()->success(
    string $title,                    // Required: Toast title
    string $description = null,       // Optional: Toast description
    int $autoCloseInMs = 5000        // Optional: Auto-close duration (default: 5000ms)
);

// Basic usage
laraToast()->success('Success!', 'Your changes have been saved.');

// With custom duration
laraToast()->info('Processing', 'Please wait while we process your request.', 3000);

// Error notification
laraToast()->danger('Error!', 'Unable to connect to the server.');

// Persistent Notification
laraToast()->danger('Error!', 'Persistent Message')->persistent();
bash
php artisan vendor:publish --tag=lara-toast-assets