Laravel Alert Messages
shani singh
Posted on June 8, 2021
In this post i am going to explain about creating beautiful alert message by using bootstrap alert component.
Let's Create a Common Blade File Called alert.blade.php
{{-- Message --}}
@if (Session::has('success'))
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-times"></i>
</button>
<strong>Success !</strong> {{ session('success') }}
</div>
@endif
@if (Session::has('error'))
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-times"></i>
</button>
<strong>Error !</strong> {{ session('error') }}
</div>
@endif
Now Use This alert blade file anywhere you want to use.
@include('common.alert')
To Pass the Alert Message in View File you can use.
return redirect()->route('users.index')->with('success', 'User Deleted successfully.');
You can access this code on TechTool India Github Repo.
You can watch the explanation video for more clarity.
To Read about Laravel User Management read below
Part - 1
Part - 2
Part - 3
Thank You for Reading
In case of any query related to LARAVEL.
Reach Out To me.
Twitter
Instagram
TechToolIndia
π πͺ π
π©
shani singh
Posted on June 8, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
laravel Generate automatic permission names from routes with spatie Laravel-permissions
October 31, 2022