Skip to content

Commit

Permalink
Update README.md (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
uxweb authored Jan 13, 2020
1 parent c2faefb commit fb88b73
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ npm run dev

### Using the Facade

First import the Alert facade in your controller.
First import the SweetAlert facade in your controller.

```php
use Alert;
use SweetAlert;
```

Within your controllers, before you perform a redirect...

```php
public function store()
{
Alert::message('Robots are working!');
SweetAlert::message('Robots are working!');

return Redirect::home();
}
Expand All @@ -114,17 +114,17 @@ public function store()
Here are some examples on how you can use the facade:

```php
Alert::message('Message', 'Optional Title');
SweetAlert::message('Message', 'Optional Title');

Alert::basic('Basic Message', 'Mandatory Title');
SweetAlert::basic('Basic Message', 'Mandatory Title');

Alert::info('Info Message', 'Optional Title');
SweetAlert::info('Info Message', 'Optional Title');

Alert::success('Success Message', 'Optional Title');
SweetAlert::success('Success Message', 'Optional Title');

Alert::error('Error Message', 'Optional Title');
SweetAlert::error('Error Message', 'Optional Title');

Alert::warning('Warning Message', 'Optional Title');
SweetAlert::warning('Warning Message', 'Optional Title');
```

### Using the helper function
Expand Down Expand Up @@ -335,63 +335,63 @@ vendor/bin/phpunit
## Demo

```php
Alert::message('Welcome back!');
SweetAlert::message('Welcome back!');

return Redirect::home();
```

![A simple alert](demos/4bvuJx9.png)

```php
Alert::message('Your profile is up to date', 'Wonderful!');
SweetAlert::message('Your profile is up to date', 'Wonderful!');

return Redirect::home();
```

![A simple alert with title](demos/GsGOtOq.png)

```php
Alert::message('Thanks for comment!')->persistent('Close');
SweetAlert::message('Thanks for comment!')->persistent('Close');

return Redirect::home();
```

![A simple alert with title and button](demos/AnRGDY2.png)

```php
Alert::info('Email was sent!');
SweetAlert::info('Email was sent!');

return Redirect::home();
```

![A info alert](demos/DxKh3Yx.png)

```php
Alert::error('Something went wrong', 'Oops!');
SweetAlert::error('Something went wrong', 'Oops!');

return Redirect::home();
```

![A error alert](demos/pIeTEYz.png)

```php
Alert::success('Good job!');
SweetAlert::success('Good job!');

return Redirect::home();
```

![A success alert](demos/pQz3ijJ.png)

```php
Alert::info('Random lorempixel.com : <img src="http://lorempixel.com/150/150/">')->html();
SweetAlert::info('Random lorempixel.com : <img src="http://lorempixel.com/150/150/">')->html();

return Redirect::home();
```

![HTML in message](demos/x44c12a.png)

```php
Alert::success('Good job!')->persistent("Close");
SweetAlert::success('Good job!')->persistent("Close");

return Redirect::home();
```
Expand Down

0 comments on commit fb88b73

Please sign in to comment.