Skip to content

hilalahmad0101/php-toastr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-toastr Package

A PHP package for displaying beautiful toast notifications

GitHub issues GitHub stars Total Downloads License

Table of Contents

Installation

You can install this package using Composer, a popular PHP package manager:

composer require hilalahmad/php-toastr

Basic Usage

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');

Notification Styles

You can display toast notifications in various styles, including:

Success

$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');

Danger

$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');

Dark

$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');

Warning

$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');

Info

$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');

Pink

$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');

Contribution

If you'd like to contribute to this package or report issues, please check the Github repo for more details.

License

This package is open-source and is licensed under the MIT License.

About

simple toastr alert for php

Resources

Stars

Watchers

Forks

Packages

No packages published