#23 Laravel 10 Tutorial | Make Admin Panel in Laravel 10 | Integrate SweetAlert2 jQuery Alert

Опубликовано: 01 Январь 1970
на канале: Stack Developers
2,100
22

►Laravel 10 Tutorial Playlist:    • Laravel 10 Tutorial: Make Admin Panel...  

In Part 23, we will continue working on CRUD Operations for CMS Pages. In this video, we will add SweetAlert 2 Confirmation jQuery Library which will ask the admin to confirm the deletion of CMS Pages. We will use this SweetAlert for all the modules later on. The sweetAlert is a replacement for JavaScript's basic alert function that shows very pretty modal windows.

We will first add a simple javascript confirm alert and then SweetAlert.

1) Simple JavaScript Alert

2) SweetAlert 2 Javascript Library

1) Simple JavaScript Alert

Add confirmDelete class and name "CMS Page" in delete page link at cms_pages.blade.php file and then create confirmDelete click event in javascript to add simple confirm alert.

Now update the custom.js file to add the confirmDelete click event in the jQuery function in which we will add confirm script. If admin confirms then we will pass return true otherwise return false.

2) SweetAlert Javascript Library

Now remove the earlier simple script to add the SweetAlert jQuery script.

Follow the below link to install SweetAlert 2
https://sweetalert2.github.io

Run the below command to install SweetAlert 2:-
npm install sweetalert2

Also, update the layout.blade.php file with below JS script.

Check if the SweetAlert script is working by adding the sample script given in the sweetalert2 website in the custom.js file.

If the script works then we will continue further.

Add record and recordid attributes in the delete CMS Page link.

In record, we will pass "cms-page" and in recordid, we will pass cms page id.

And disable href and keep class "confirmDelete" that we have added earlier.

Now update custom.js file and add Jquery script there with SweetAlert.

Now check in video, our SweetAlert is working fine while deleting CMS Page.

►Click here to subscribe for Laravel & other updates -    / stackdevelopers  

Popular Stack Developers Series that can help you:-

►Laravel Multi-Vendor E-commerce Website -    • Laravel Multi Vendor Tutorial  

►React JS Tutorial for Beginners with Laravel -    • React JS Tutorial with Laravel for Be...  

►Laravel Tutorial for Beginners -    • Laravel Tutorial for Beginners | Adva...  

►GIT Tutorial for Beginners -    • Git Tutorial for Beginners | Create y...  

►Laravel API Tutorial -    • Laravel API Tutorial | Create API fro...  

►Laravel Interview Questions -    • Laravel Interview Questions & Answers...  

►jQuery Tutorial -    • jQuery Tutorial  

►Laravel Basic E-commerce Series -    • Make Admin Panel / E-commerce Website...  

►Laravel Dating Series -    • Make Dating / Social Networking Websi...  

►Join this channel to get the complete source code of all series:
   / @stackdevelopers  

Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates -   / stackdevelopers2  
►Join Facebook Group to resolve your queries -   / stackdevelopers  
►Follow on Instagram -   / stackdevelopers2  
►Follow on GitHub - https://github.com/stackdevelopers

#laravel10 #laravel10tutorial #laravel


Смотрите видео #23 Laravel 10 Tutorial | Make Admin Panel in Laravel 10 | Integrate SweetAlert2 jQuery Alert онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stack Developers 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,10 раз и оно понравилось 2 людям.