A PHP package for displaying beautiful toast notifications
You can install this package using Composer, a popular PHP package manager:
composer require hilalahmad/php-toastr
To use this package for displaying toast notifications, simply include it in your PHP code:
use Hilalahmad\PhpToastr\Toastr;
$toastr=new Toastr();
$toastr->success('Lorem ipsum dolor sit');
Or
use Hilalahmad\PhpToastr\Toastr;
Toastr::success('Lorem ipsum dolor sit');
You can display toast notifications in various styles, including:
$toastr->success('Lorem ipsum dolor sit','topLeft');
$toastr->success('Lorem ipsum dolor sit','topRight');
$toastr->success('Lorem ipsum dolor sit','bottomLeft');
$toastr->success('Lorem ipsum dolor sit','bottomRight');
$toastr->success('Lorem ipsum dolor sit','topCenter');
$toastr->success('Lorem ipsum dolor sit','bottomCenter');
Or
Toastr::success('Lorem ipsum dolor sit','topLeft');
Toastr::success('Lorem ipsum dolor sit','topRight');
Toastr::success('Lorem ipsum dolor sit','bottomLeft');
Toastr::success('Lorem ipsum dolor sit','bottomRight');
Toastr::success('Lorem ipsum dolor sit','topCenter');
Toastr::success('Lorem ipsum dolor sit','bottomCenter');
$toastr->danger('Lorem ipsum dolor sit','topLeft');
$toastr->danger('Lorem ipsum dolor sit','topRight');
$toastr->danger('Lorem ipsum dolor sit','bottomLeft');
$toastr->danger('Lorem ipsum dolor sit','bottomRight');
$toastr->danger('Lorem ipsum dolor sit','topCenter');
$toastr->danger('Lorem ipsum dolor sit','bottomCenter');
Or
Toastr::danger('Lorem ipsum dolor sit','topLeft');
Toastr::danger('Lorem ipsum dolor sit','topRight');
Toastr::danger('Lorem ipsum dolor sit','bottomLeft');
Toastr::danger('Lorem ipsum dolor sit','bottomRight');
Toastr::danger('Lorem ipsum dolor sit','topCenter');
Toastr::danger('Lorem ipsum dolor sit','bottomCenter');
$toastr->dark('Lorem ipsum dolor sit','topLeft');
$toastr->dark('Lorem ipsum dolor sit','topRight');
$toastr->dark('Lorem ipsum dolor sit','bottomLeft');
$toastr->dark('Lorem ipsum dolor sit','bottomRight');
$toastr->dark('Lorem ipsum dolor sit','topCenter');
$toastr->dark('Lorem ipsum dolor sit','bottomCenter');
Or
Toastr::dark('Lorem ipsum dolor sit','topLeft');
Toastr::dark('Lorem ipsum dolor sit','topRight');
Toastr::dark('Lorem ipsum dolor sit','bottomLeft');
Toastr::dark('Lorem ipsum dolor sit','bottomRight');
Toastr::dark('Lorem ipsum dolor sit','topCenter');
Toastr::dark('Lorem ipsum dolor sit','bottomCenter');
$toastr->warning('Lorem ipsum dolor sit','topLeft');
$toastr->warning('Lorem ipsum dolor sit','topRight');
$toastr->warning('Lorem ipsum dolor sit','bottomLeft');
$toastr->warning('Lorem ipsum dolor sit','bottomRight');
$toastr->warning('Lorem ipsum dolor sit','topCenter');
$toastr->warning('Lorem ipsum dolor sit','bottomCenter');
Or
Toastr::warning('Lorem ipsum dolor sit','topLeft');
Toastr::warning('Lorem ipsum dolor sit','topRight');
Toastr::warning('Lorem ipsum dolor sit','bottomLeft');
Toastr::warning('Lorem ipsum dolor sit','bottomRight');
Toastr::warning('Lorem ipsum dolor sit','topCenter');
Toastr::warning('Lorem ipsum dolor sit','bottomCenter');
$toastr->info('Lorem ipsum dolor sit','topLeft');
$toastr->info('Lorem ipsum dolor sit','topRight');
$toastr->info('Lorem ipsum dolor sit','bottomLeft');
$toastr->info('Lorem ipsum dolor sit','bottomRight');
$toastr->info('Lorem ipsum dolor sit','topCenter');
$toastr->info('Lorem ipsum dolor sit','bottomCenter');
Or
Toastr::info('Lorem ipsum dolor sit','topLeft');
Toastr::info('Lorem ipsum dolor sit','topRight');
Toastr::info('Lorem ipsum dolor sit','bottomLeft');
Toastr::info('Lorem ipsum dolor sit','bottomRight');
Toastr::info('Lorem ipsum dolor sit','topCenter');
Toastr::info('Lorem ipsum dolor sit','bottomCenter');
$toastr->pink('Lorem ipsum dolor sit','topLeft');
$toastr->pink('Lorem ipsum dolor sit','topRight');
$toastr->pink('Lorem ipsum dolor sit','bottomLeft');
$toastr->pink('Lorem ipsum dolor sit','bottomRight');
$toastr->pink('Lorem ipsum dolor sit','topCenter');
$toastr->pink('Lorem ipsum dolor sit','bottomCenter');
Or
Toastr::pink('Lorem ipsum dolor sit','topLeft');
Toastr::pink('Lorem ipsum dolor sit','topRight');
Toastr::pink('Lorem ipsum dolor sit','bottomLeft');
Toastr::pink('Lorem ipsum dolor sit','bottomRight');
Toastr::pink('Lorem ipsum dolor sit','topCenter');
Toastr::pink('Lorem ipsum dolor sit','bottomCenter');
If you'd like to contribute to this package or report issues, please check the Github repo for more details.
This package is open-source and is licensed under the MIT License.