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

Overview

SweetAlert2

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

Total Downloads Latest Stable Version Support me on Patreon License

Install

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

composer require realrashid/sweet-alert

Documentation



Checkout the Js Library


Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

❤️ Open-Source Software - Give ⭐️

I have included the awesome symfony/thanks composer package as a dev dependency. Let your OS package maintainers know you appreciate them by starring the packages you use. Simply run composer thanks after installing this package. (And not to worry, since it's a dev-dependency it won't be installed in your live environment.)

License

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

Made with ❤️ from Pakistan

note: if you are using sweet-alert v1.0 you can get README for v1.0 from here

Comments
  • Session issue

    Session issue

    • Package Version: 3.1.4
    • Laravel Version: 7.0

    when I goes back from edit page without saving data it shows the message of last action which we have performed and displayed in toast.

    It is not only on edit page it is on every page

    opened by afrasiyabhaider 18
  • Shows option to select a file when not necessary

    Shows option to select a file when not necessary

    • Package Version: 1.1.1
    • Laravel Version: 5.7

    Description:

    Alert notifications are coming with an option to select file when unnecessary.

    Steps To Reproduce:

    image

    opened by timomch2 16
  • Uncaught ReferenceError: swal is not defined

    Uncaught ReferenceError: swal is not defined

    Hi, Rashid

    I had to wrap the alert in a section: (in this case 'scripts')

    @section('scripts')
        @if (alert()->ready())
            <script>
                swal({
                    title: "{!! alert()->message() !!}"
                });
            </script>
        @endif
    @endsection
    

    And then add:

    @yield('scripts')

    below my other script files in the layout template to make it work. Otherwise a get an Uncaught ReferenceError: swal is not defined error.

    Can you tell me why or is there another workaround to do this?

    Thank you for this package!

    Richard

    Specifications:

    • PHP Version: 7.1.9
    • Laravel Version: 5.6
    help wanted 
    opened by hoekie 15
  • Required parameter $imageUrl follows optional parameter $title

    Required parameter $imageUrl follows optional parameter $title

    • Laravel Version: 8.0

    • PHP 7.4

    Description: It says Required parameter $imageUrl follows optional parameter $title

    You must need to declare the default value for parameter $imageUrl

    in src/Toastr.php class in image function.

    opened by Kashif-Kframe 14
  • Error when include view

    Error when include view

    Error view

    When include the view by default, the system show error -> View [alert] not found

    image

    image

    image

    Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

    • Laravel 5.5 | sweetAlert2 - 1.1
    • Ubuntu 16.04
    opened by ssheduardo 13
  • Alerts with inputs/confirmation

    Alerts with inputs/confirmation

    Hi! Is there a way to implement alerts with inputs or/and confirmation?

    Detailed description

    I'm dealing with two situations right now:

    1. I want my user to confirm and option before doing it. For example: deleting an post. I will like to launch an alert that says something like: "Are you sure about that?" and then, if the users clicks the confirmButton, i will delete the post. Either way, it would stay the same.

    2. The user needs to pass a parameter to the controller to check something like a second password. I'll like to launch an alert with the input an deal with it on my controller.

    Context

    SweetAlert2 has this options and they are amazing so, it will be cool if this package adds it.

    Your environment

    Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

    • Version used: Laravel v5.6, SweetAlert2 v^1.1
    • Ubuntu 16.04
    feature request 
    opened by enbermudas 12
  • Not Displayed proper alert message in the master file

    Not Displayed proper alert message in the master file

    • Package Version: #.#.#
    • Laravel Version: 6.0

    Description:

    Alert gives proper output outside of the master file. But when using in the master file then it gives this [ https://user-images.githubusercontent.com/22576412/65787763-7e6fe480-e17b-11e9-9db9-35a6e4e09db4.png ] output.

    Steps To Reproduce:

    opened by musa-33 10
  • Laravel v5.7 not support?

    Laravel v5.7 not support?

    Laravel v5.7 Operating system Windows 10

    in Controller

    Use Alert; function test() { alert()->success('Post Created', 'Successfully'); }

    Chrome browser does not show anything.

    opened by eric2100 8
  • Alert doesnot appears, Please help

    Alert doesnot appears, Please help

    Hello, I want to use this sweet-alert and i have included it in composer "realrashid/sweet-alert": "^1.1",

    and in controller i have used use RealRashid\SweetAlert\Facades\Alert;

    image

    in backend i have linked script as image

    in view file image image

    then also I cant get any alert and there are no errors please help.

    • Version used (e.g. Laravel v5.5, SweetAlert2 v7.18.0):
    opened by theenescresta 8
  • Alert.config array empty after passing alert via a redirect.

    Alert.config array empty after passing alert via a redirect.

    • Package Version: 3.1.4
    • Laravel Version: 7.9.2

    Description:

    Alert.config array empty after passing alert via a redirect.

    Steps To Reproduce:

    Called: return redirect(route('home'))->with('success', 'Task Created Successfully!');

    No alert fired, despite all config steps followed.

    After investigating, dumping session()->all() returns

    array:6 [▼
    ...
      "alert" => []
      "success" => "Task Created Successfully!"
    ]
    
    opened by adammpkins 7
  • QUESTION: calling SweetAlert using JS in Laravel

    QUESTION: calling SweetAlert using JS in Laravel

    Detailed description

    I use this package in my Laravel 6 setup and it works beautifully. I do have some JS in my project (mostly AJAX calls) and I want to give the user feedback through sweetalert. Using the documentation I used the following code:

    const Toast = Swal.mixin({ toast: true, position: 'top-end', showConfirmButton: false, timer: 5000, timerProgressBar: true, onOpen: (toast) => { toast.addEventListener('mouseenter', Swal.stopTimer) toast.addEventListener('mouseleave', Swal.resumeTimer) } });

    In the JS I call the Toast using:

    Toast.fire({ icon: 'success', title: 'This is a success toast!' });

    This code is based on the example found at the end of the Configuration segment over at SweetAlert 2 readme.

    The problem, however, is that the toast is displaying, but the icon (in the case of the provided example "success") is not shown. I suspect that the JS version does not know where the icons are, so that would explain the fact the icon is not showing.

    So how can I point towards the location of the icon and have it shown in the Toast?

    opened by schonhose 7
  • Return Redirect on Middleware not showing Error type

    Return Redirect on Middleware not showing Error type

    • Package Version: #.#.#
    • Laravel Version: #.#.#

    Description:

    After following the documentation, when returning/redirecting from middleware the error type does not show the sweetalert. I tried with types success, info, question and warning, they all work. Steps To Reproduce:

    Setup middleware and add ->with('warning', 'Whoops!'); to the return or redirect. It does not show the sweetalert. Test again using ->with('info', 'Whoops!'); and it does work.

    (Disclaimer, I am a new to php and laravel so I may be missing something)

    Steps To Reproduce:

    opened by rohi1386 1
  • Confirm before deletion

    Confirm before deletion

    I am using Laravel 6.5 with sweet alert's 2.0.3 version

    I want to know that, how to display the confirm button before the deletion of data? If user press yes delete it it should be deleted otherwise it shouldn't be deleted

    opened by afrasiyabhaider 17
Releases(v.5.1.1)
  • v.5.1.1(Aug 29, 2022)

  • v5.1.0(May 28, 2022)

  • v5.0.0(Feb 4, 2022)

  • v4.1.0(Nov 6, 2021)

  • v4.0.0(Jun 14, 2021)

  • v3.2.3(May 26, 2021)

  • v3.2.2(Feb 17, 2021)

  • v3.2.1(Jan 14, 2021)

  • v3.2.0(Dec 2, 2020)

  • v3.1.7(Sep 9, 2020)

  • v3.1.6(Jul 17, 2020)

    • Added flexibility to Always load the sweetalert.all.js and Never load the sweetalert.all.js by farhanianz
    • Upgraded SweetAlert2 to latest version
    • Minor Changes in Middleware.md
    • Docs Updated
    Source code(tar.gz)
    Source code(zip)
  • v3.1.5(Jun 11, 2020)

  • v3.1.4(Mar 31, 2020)

  • v3.1.3(Feb 22, 2020)

  • v3.1.2(Jan 24, 2020)

  • v3.1.1(Jan 7, 2020)

    • Upgraded SweetAlert2 to latest version 🎉
    • Added ability to activate or not the middleware error messages 🎉
    • Docs Updated 🎉
    • Fixed #64
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Dec 29, 2019)

    • Upgraded SweetAlert2 to latest version :tada:
    • Added Tidelift to funding.yaml :tada:
    • Added SECURITY.md in .github/SECURITY.md :tada:
    • Added timerProgressBar() method :tada:
    • Added PublishCommand to easily publish the package assets :tada:
    • Updated question() alert method :tada:
    • Refactor SweetAlertServiceProvider class :tada:
    • Refactor Toaster class :tada:
    • Refactor functions.php file :tada:
    • Updated PHPDocBlocks :tada:
    • Docs Updated :tada:
    Source code(tar.gz)
    Source code(zip)
  • v3.0.1(Nov 27, 2019)

    • Updated animation($showClass = [], $hideClass = []) to animation($showAnimation, $hideAnimation)
    • Docs Updated
    • Fixed animations issue
    • Fixed #59
    Source code(tar.gz)
    Source code(zip)
  • v3.0(Nov 21, 2019)

    • :tada: Upgraded SweetAlert2 to latest version
    • :tada: Added option to pass SweetAlert2 CDN link from included view
    • :tada: Updated animation($showClass = [], $hideClass = []) method
    • :tada: Added buttonsStyling() method
    • :tada: Added iconHtml() method
    • :tada: Docs Updated
    • :tada: Fix some bugs
    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Oct 13, 2019)

  • v2.0.2(Sep 10, 2019)

  • v2.0.1(Sep 5, 2019)

  • v2.0(Jun 14, 2019)

    v2.0 - 2019-06-14

    • Upgraded SweetAlert2 to latest version
    • Added width() helper method
    • Added padding() helper method
    • Added background() helper method
    • Added animation() helper method
    • Added focusConfirm() helper method
    • Added focusCancel() helper method
    • Added CDN Support
    • Docs Updated
    • Fix some bugs

    Changes

    // From
    public function toast($title = '', $type = '', $position = 'bottom-right'){...}
    // To
    public function toast($title = '', $type = ''){...}
    
    // set the default position in package config file or use the helper method position()
    
    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Mar 29, 2019)

    v1.1.2 - 2019-03-29

    • Upgraded SweetAlert2 to latest version
    • Added hideCloseButton() helper method
    • Added reverseButtons() helper method
    • Added image() method
    • Added addImage() helper method
    • Added position() helper method
    • Docs Updated
    • Fix some bugs
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Nov 3, 2018)

    Bug Fixes #6 #10 #22 #23

    Added Middleware support

    Added hideClose() function toast Bug Fix #13

    toast('Your Post as been submited!','success','top-right')->hideCloseButton();
    
    Source code(tar.gz)
    Source code(zip)
  • v1.1(Apr 4, 2018)

Owner
Rashid Ali
Co-founder | @9Webb | Muslim | Pakistani | Student | Full Stack Developer | Instagram: rashidali.05
Rashid Ali
Laravel is accessible, powerful, and provides tools required for large, robust applications.

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be trul

Web & Mobile | eCommerce | Full-Stack Developer 4 Nov 24, 2022
Aplicación Laravel-Livewire-Tailwind. La aplicación se conecta a APIRest y muestra resultados, búsquedas, historial, Responsive Design

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Juan Gómez 0 Feb 10, 2022
cybercog 996 Dec 28, 2022
Customizable Feedback Component for Laravel

Laravel Feedback Component allows you to easily implement a Customer Feedback component on your website. It is build with VueJS but can be implemented in any kind of Laravel Project. You just need to drop a few lines in your layout.

Clément Rigo 254 Dec 25, 2022
API Blueprint Renderer for Laravel, customizable via Blade templates

API Blueprint Renderer for Laravel This Laravel package Blueprint Docs renders your API Blueprint. It comes with a standard theme that you can customi

Michael Schmidt-Voigt 225 Sep 16, 2022
Fully customizable and tests supported Laravel admin dashboard for developers.

Laravel Admin dashboard Like Laravel Jetstream but built with Hotwire Turbo + additional perks. Tools used: tailwindcomponents/dashboard Hotwire Turbo

null 12 Nov 1, 2022
An Easy, Customizable & Open Source Robux Rewards Website Made With Laravel

RbxDream - Robux Earning Rewards Website Coming Soon Current repo not stable. This is an open source Robux rewards site. Understanding Core Concepts T

Underground 3 Feb 15, 2022
Ignition: a beautiful error page for Laravel apps

Ignition is a beautiful and customizable error page for Laravel applications running on Laravel 5.5 and newer. It is the default error page for all Laravel 6 applications.

Spatie 260 Dec 29, 2022
Laravel Echo library for beautiful Pusher and Ably integration.

Introduction In many modern web applications, WebSockets are used to implement realtime, live-updating user interfaces. When some data is updated on t

The Laravel Framework 980 Dec 31, 2022
A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards.

TALL multiselect cards A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards. Table of content

Frederic Habich 19 Dec 14, 2022
A collection of tools for rapidly building beautiful TALL stack interfaces, designed for humans.

Filament is a collection of tools for rapidly building beautiful TALL stack interfaces, designed for humans. Packages Admin Panel • Documentation • De

Filament 5.4k Jan 4, 2023
List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

Laravel Lang 6.9k Jan 2, 2023
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.

What is laravel charts? Charts is a Laravel library used to create Charts using Chartisan. Chartisan does already have a PHP adapter. However, this li

Erik C. Forés 31 Dec 18, 2022
Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster.

Laravel Kickstart What is Laravel Kickstart? Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster. It com

Sam Rapaport 46 Oct 1, 2022
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application.

Laravel Segment Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application. Installation You can install the pac

Octohook 13 May 16, 2022
Laravel Sanctum support for Laravel Lighthouse

Lighthouse Sanctum Add Laravel Sanctum support to Lighthouse Requirements Installation Usage Login Logout Register Email Verification Forgot Password

Daniël de Wit 43 Dec 21, 2022
Bring Laravel 8's cursor pagination to Laravel 6, 7

Laravel Cursor Paginate for laravel 6,7 Installation You can install the package via composer: composer require vanthao03596/laravel-cursor-paginate U

Pham Thao 9 Nov 10, 2022
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021