Skip to content
pakainfo

Pakainfo

Web Development & Good Online education

  • Home
  • Blog
  • Categories
  • Tools
  • Full Form
  • Guest Post
    • Guest Posting Service
  • Advertise
  • About
  • Contact Us

Laravel 6 Sweet Alert Tutorial With Example

January 21, 2020 Pakainfo Technology, Ajax, JavaScript, jQuery, Laravel, Mysql, Mysqli, php, Programming Leave a comment

Today, We want to share with you Laravel 6 Sweet Alert Tutorial With Example.In this post we will show you laravel 6 sweet alert confirm delete, hear for Inlining flash messages with the redirect() call in Laravel we will give you demo and example for implement.In this post, we will learn about Laravel: Display Flash Message after Registration or Login in Blade template with an example.

Laravel 6 Sweet Alert Tutorial With Example

Contents

  • Laravel 6 Sweet Alert Tutorial With Example
    • Step 1 INSTALL LARAVEL 6 Web Application
    • Step #2 Install Laravel 6 Sweet Alert Package
    • Step 3 Create a Laravel 6 Controller
    • Step 4 Define a Laravel 6 Route
    • Step 5 Create a Laravel View Blade File
    • Read
    • Summary
    • Related posts

There are the Following The simple About how to use sweetalert in laravel controller Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to use sweetalert message box in laravel 6?, so the Display Sweet Alert in Laravel 6 using uxweb/sweet-alert is used for this example is following below.

Step 1: INSTALL LARAVEL 6 Web Application

install sweetalert2 laravel Project

composer create-project --prefer-dist laravel/laravel sweetalertexample

Step #2: Install Laravel 6 Sweet Alert Package

realrashid/sweetalert

composer require uxweb/sweet-alert

in Laravel Added providers
'providers' => [
   	   UxWeb\SweetAlert\SweetAlertServiceProvider::class,
   ];

in Laravel Added ‘aliases’

'aliases' => [
   ‘Alert’ => UxWeb\SweetAlert\SweetAlert::class,
 ];

Step 3: Create a Laravel 6 Controller

php artisan make:controller NotificationController

NotificationController.php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Alert;

class NotificationController extends Controller
{
    public function notification($type)
    {
        switch ($type) {
            case 'message':
                Alert::message('BookMyShow TamilRokers','Message');
                break;
            case 'basic':
                Alert::basic('Grettings TamilRokers','Basic');
                break;
            case 'info':
                Alert::info('Mail Sent TamilRokers successfully','Info');
                break;
            case 'success':
                Alert::success('Your comments has been successfully sent', 'Success');
                break;
            case 'error':
                Alert::error('Movis list went wrong.TamilRokers','Error');
                break;
            case 'warning':
                Alert::warning('Please Enabled TamilRokers account','Warning');
                break;
            default:
                break;
        }
        return view('sweetalert');
    }
}

Step 4: Define a Laravel 6 Route

routes/web.php

Route::get('sweetalert/{type}','[email protected]');

Step 5: Create a Laravel View Blade File

resources/views/sweetalert.blade.php

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>How to Implement Sweet Alert in Laravel Application - Tamilrokers</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.0/sweetalert.min.js"></script>
  </head>
  <body>
    <h2>How to Implement Sweet Alert in Laravel 6 Web Application</h2>
    @include('sweet::alert')

	<footer>
	  <p>Posted by: Tamil Rokers</p>
	  <p>Contact information: <a href="mailto:[email protected]">
	  [email protected]</a>.</p>
	</footer>
  </body>
</html>

Web Programming Tutorials Example with Demo

Read :

  • Jobs
  • Make Money
  • Programming
Also Read This 👉   Laravel set global Variable in middleware, all controller and views

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about laravel 6 sweet alert confirm delete.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related posts:

  1. how to use sweet alert in html?
  2. Create custom sweet alert function with php Example
  3. Alert Toast message in Angularjs Component
  4. How to use sweet alert for delete confirm in Codeigniter?
  5. Laravel Bootstrap Alert (flash message) with Examples
  6. Multiple image slider in html source code
Display Sweet Alert in Laravel 6 using uxweb/sweet-alertHow to Implement Sweet Alert in Laravel Applicationhow to use sweetalert in laravel controllerHow to use sweetalert message box in laravel 6?Inlining flash messages with the redirect() call in Laravelinstall sweetalert2 laravellaravel 6 sweet alert examplelaravel 6 sweetalertlaravel alert boxlaravel alert messagelaravel and sweetalertlaravel sweet alert confirm deletelaravel sweet alert not workinglaravel sweet alert tutorialLaravel Sweet Alert Tutorial With ExampleLaravel SweetAlertlaravel sweetalert deleteLaravel: Display Flash Message after Registration or Login in Blade templaterealrashid/sweet-alertsweet alert delete confirmation laravel 6sweet alert for laravel 6 examplesweetalertsweetalert laravel 6use swal in laravel controller

Post navigation

Previous Post:Laravel 6 Advanced Where Clauses Tutorial With Example
Next Post:Session Flash Messages in Laravel 6 Tutorial

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me

Categories

3movierulz (64) Ajax (464) AngularJS (377) ASP.NET (61) Bio (109) Bollywood (108) Codeigniter (175) CSS (98) Earn Money (94) Education (65) Entertainment (131) fullform (87) Google Adsense (64) Highcharts (77) History (40) Hollywood (109) JavaScript (1359) Jobs (43) jQuery (1423) Laravel (1088) LifeStyle (53) movierulz4 (63) Mysql (1035) Mysqli (894) php (2133) Programming (2346) Python (99) Software (197) Software (94) Stories (98) tamilrockers (104) Tamilrockers kannada (64) Tamilrockers telugu (61) Tech (149) Technology (2425) Tips and Tricks (130) Tools (215) Top10 (514) Trading (98) Trending (79) VueJs (250) Web Technology (116) webtools (201) wordpress (166) World (351)

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here
  • Home
  • About Us
  • Terms And Conditions
  • Write For Us
  • Advertise
  • Contact Us
  • Youtube Tag Extractor
  • Info Grepper
  • Guest Posting Sites
  • Increase Domain Authority
  • Social Media Marketing
  • Freelance web developer
  • Tools
Pakainfo 9-OLD, Ganesh Sco, Kothariya Ring Road, Chokadi, Rajkot - 360002 India
E-mail : [email protected]
Pakainfo

© 2023 Pakainfo. All rights reserved.

Top
Subscribe On YouTube : Download Source Code
We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype Guest Posting Sites