PHP code example of polashmahmud / inertia-toast
1. Go to this page and download the library: Download polashmahmud/inertia-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/ */
polashmahmud / inertia-toast example snippets
return [
'position' => 'bottom-right', // top-left | top-center | top-right | bottom-left | bottom-center | bottom-right
'closeButton' => true,
'expand' => false,
'theme' => 'system', // light | dark | system
'richColors' => true,
'toastOptions' => [
'style' => [],
'class' => '',
'descriptionClass' => '',
],
];
return back()->with('success', 'That worked nicely');
return back()->with('warning', ['That worked nicely', 'Please check again']);
return back()->with('error', [
'message' => 'Something went wrong!',
'description' => 'Please try again after 5 seconds.',
]);
'toastOptions' => [
'style' => [
'background' => '#fda4af',
],
'class' => 'bg-red-500 text-white',
'descriptionClass' => 'text-red-100',
],
bash
php artisan vendor:publish --tag="inertia-toast-config"
js
module.exports = {
content: [
"./resources/**/*.blade.php",
"./resources/**/*.js",
"./resources/**/*.vue",
"./config/inertia-toast.php", // Add this line
],
// ...
};