Skip to content

Commit

Permalink
Updated to v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
realrashid committed Nov 3, 2018
1 parent 93ff28c commit baf7e4f
Show file tree
Hide file tree
Showing 21 changed files with 958 additions and 354 deletions.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "🐛 Bug Report"
about: Report a general package issue

---

- Package Version: #.#.#
- Laravel Version: #.#.#

### Description:


### Steps To Reproduce:
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"RealRashid\\SweetAlert\\SweetAlertServiceProvider"
],
"aliases": {
"Alert": "RealRashid\\SweetAlert\\Facades"
"Alert": "RealRashid\\SweetAlert\\Facades\\Alert"
}
}
},
Expand Down
Empty file added docs/.nojekyll
Empty file.
19 changes: 19 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<p align="center">
<a href="https://packagist.org/packages/realrashid/sweet-alert"><img src="https://poser.pugx.org/realrashid/sweet-alert/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/realrashid/sweet-alert"><img src="https://poser.pugx.org/realrashid/sweet-alert/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/realrashid/sweet-alert"><img src="https://poser.pugx.org/realrashid/sweet-alert/license.svg" alt="License"></a>
<a href="https://www.patreon.com/realrashid"><img alt="Support me on Patreon" src="http://ionicabizau.github.io/badges/patreon.svg"></a>
<a href="https://liberapay.com/realrashid/donate"><img alt="Support me on Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
</p>

# Introduction

A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES

ZERO DEPENDENCIES

<p align="center">
<img src="https://raw.github.com/sweetalert2/sweetalert2/master/assets/sweetalert2.gif" width="562" height="388">
</p>

> note: if you are using sweet-alert v1.0 you can get READMEfor v1.0 from [here](https://github.com/realrashid/sweet-alert/blob/1.0/readme.md)
10 changes: 10 additions & 0 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h1>sweet-alert <small>1.1.1</small></h1>

<h4>By <strong>Rashid Ali</strong></h4>

> A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE,
ZERO DEPENDENCIES


[GitHub](https://github.com/realrashid/sweet-alert)
[Get Started](/introduction)
10 changes: 10 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

* Getting started

* [Installation](sweet-alert/install.md)
* [Configuration](sweet-alert/config.md)
* [Usage](sweet-alert/usage?id=usage)
* [Middleware](sweet-alert/middleware?id=middleware)
* [Demo](sweet-alert/demo)

* [Credits](sweet-alert/credits.md)
41 changes: 41 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Configuration

> Optional in Laravel 5.5 or above
After installing the sweet-alert package, register the

```php
RealRashid\SweetAlert\SweetAlertServiceProvider::class
```
in your `config/app.php` configuration file:

```php
'providers' => [
// Other service providers...

RealRashid\SweetAlert\SweetAlertServiceProvider::class,
],
```

Also, add the `Alert` facade to the `aliases` array in your `app` configuration file:

```php
'Alert' => RealRashid\SweetAlert\Facades\Alert::class,
```

# Include SweetAlert 2 View

in your master layout

```php
@include('sweetalert::alert')`
```

and run the below command to publish the sweetalert.all.js in your public assets.

```bash
php artisan vendor:publish --tag=public
```

> note: the javascript library of sweetalert.all.js is already loaded in above included view
41 changes: 41 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Methods Definition

#### Alert Methods

| Method | Argument |
|:---------------------: |:------------------------------: |
| `alert()` | `$title, $message, $type` |
| `alert()->success()` | `$title, $message` |
| `alert()->info()` | `$title, $message` |
| `alert()->warning()` | `$title, $message` |
| `alert()->error()` | `$title, $message` |
| `alert()->question()` | `$title, $message` |
| `alert()->html()` | `$htmltitle, $htmlCode, $type` |
| `toast()` | `$message, $type, $position` |

#### Chain Methods

| Chain Method | Argument | Snippet |
|:---------------------: |:------------------------------------------------: |:-----------------------------------------------------------------------------------------------: |
| `persistent()` | `$showConfirmBtn = true, $showCloseBtn = false` | `alert()->success('Alert Persistent', 'Successfully')->persistent(false,true);` |
| `autoClose()` | `$milliseconds = 5000` | `alert()->info('I am going to close after', '5 seconds')->autoClose(5000);` |
| `showConfirmButton()` | `$btnText = 'Ok', $btnColor = '#3085d6'` | `alert()->info('Info', 'Alert')->showConfirmButton('Button Text','#3085d6');` |
| `showCancelButton()` | `$btnText = 'Cencel', $btnColor = '#aaa'` | `alert()->question('Is Post Created', 'Successfully?)->showCancelButton('Button Text','#aaa');` |
| `showCloseButton()` | `$closeButtonAriaLabel = 'aria-label'` | `alert()->warning('Post Created', 'Successfully')->showCloseButton('aria-label');` |
| `footer()` | `$htmlcode` | `alert()->error('Oops...', 'Something went wrong!')->footer('<a href>Why do I have this issue?</a>');` |
| `toToast()` | `$position = 'top-right'` | `alert()->success('Post Created', 'Successfully')->toToast();` |
| | | |
| | | |
> can also support multiple chaining
``` php

alert()
->error('Oops...', 'Something went wrong!')
->footer('<a href>Why do I have this issue?</a>')
->showConfirmButton()
->showCancelButton()
->showCloseButton()
->autoClose(5000);

```
21 changes: 21 additions & 0 deletions docs/credits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Credits

* [SweetAlert2](https://github.com/sweetalert2/sweetalert2)

# Contributing

Please see [CONTRIBUTING](https://github.com/realrashid/sweet-alert/blob/master/CONTRIBUTING.md) and [CODE_OF_CONDUCT](https://github.com/realrashid/sweet-alert/blob/master/CODE_OF_CONDUCT.md) for details.

# Connect with Me

* Website: http://realrashid.com
* Email: [email protected]
* Twitter: http://twitter.com/rashidali05
* Facebook: https://www.facebook.com/rashidali05
* GitHub: https://github.com/realrashid

# License

SweetAlert2 is open-sourced software licensed under the MIT License (MIT). Please see [License File](LICENSE.md) for more information.

<p align="center"> <b>Made :heart: with Pakistan<b> </p>
117 changes: 117 additions & 0 deletions docs/demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
## Alert Demo

##### Success Alert

``` php
alert()->success('SuccessAlert','Lorem ipsum dolor sit amet.');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/alert/SuccessAlert.png" alt="SuccessAlert">
</p>

##### Info Alert

``` php
alert()->info('InfoAlert','Lorem ipsum dolor sit amet.');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/alert/InfoAlert.png" alt="InfoAlert">
</p>

##### Warning Alert

``` php
alert()->warning('WarningAlert','Lorem ipsum dolor sit amet.');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/alert/WarningAlert.png" alt="WarningAlert">
</p>

##### Question Alert

``` php
alert()->question('QuestionAlert','Lorem ipsum dolor sit amet.');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/alert/QuestionAlert.png" alt="QuestionAlert">
</p>

##### Error Alert

``` php
alert()->error('ErrorAlert','Lorem ipsum dolor sit amet.');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/alert/ErrorAlert.png" alt="ErrorAlert">
</p>

##### Html Alert

``` php
alert()->html('<i>HTML</i> <u>example</u>',"
You can use <b>bold text</b>,
<a href='//github.com'>links</a>
and other HTML tags
",'success');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/alert/HtmlAlert.png" alt="HtmlAlert">
</p>

# Toast Demo

##### Success Toast

``` php
toast('Success Toast','success','top-right');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/toast/SuccessToast.png" alt="SuccessToast">
</p>

##### Info Toast

``` php
toast('Info Toast','info','top-right');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/toast/InfoToast.png" alt="InfoToast">
</p>

##### Warning Toast

``` php
toast('Warning Toast','warning','top-right');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/toast/WarningToast.png" alt="WarningToast">
</p>

##### Question Toast

``` php
toast('Question Toast','question','top-right');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/toast/QuestionToast.png" alt="QuestionToast">
</p>

##### Error Toast

``` php
toast('Error Toast','error','top-right');
```

<p align="center">
<img src="https://raw.githubusercontent.com/realrashid/sweet-alert/master/imgs/toast/ErrorToast.png" alt="ErrorToast">
</p>
45 changes: 45 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel SweetAlert by Rashid Ali</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

<meta property="og:title" content="sweet-alert">
<meta property="og:description" name="description" content="A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE,
ZERO DEPENDENCIES for Laravel by Rashid Ali">
<meta property="og:image" content="https://sweetalert2.github.io/images/apple-touch-icon.png">
<meta property="og:url" content="https://realrashid.github.io/sweet-alert">
<link rel="icon" href="https://sweetalert2.github.io/images/favicon.png">
<link rel="apple-touch-icon" href="https://sweetalert2.github.io/images/apple-touch-icon.png">

<meta name="theme-color" content="#f2f4f6">

<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">

</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
auto2top: true,
coverpage: true,
executeScript: true,
loadSidebar: true,
subMaxLevel: 2,
routerMode: 'history',
themeColor: '#3F51B5',
name: 'sweet-alert',
repo: 'https://github.com/realrashid/sweet-alert'
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify-copy-code"></script>
<script>
if (typeof navigator.serviceWorker !== 'undefined') {
navigator.serviceWorker.register('sw.js')
}
</script>
</body>
</html>
7 changes: 7 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Install

To get started with SweetAlert2, use Composer to add the package to your project's dependencies:

```
composer require realrashid/sweet-alert
```
Loading

0 comments on commit baf7e4f

Please sign in to comment.