Laravel 10 Tutorial #42 | Categories Module (IX) | Add/Edit Category | View/Delete Category Image

Опубликовано: 05 Октябрь 2024
на канале: Stack Developers
762
7

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

In Part-42 of the Laravel 10 Tutorial, we will continue working on the Categories module. In this video, we will add functionality to view and delete category image with SweetAlert 2 Confirmation jQuery Alert.

1) Update add_edit_category.blade.php file :-
Show Category Image in Edit Category form when category image is added by the admin.

Delete Category Image
Add a "Delete Image" link where we are displaying the category image in edit category form.

2) Create Route:-
Create GET Route with parameter category id in web.php file like below:-

Route::get('delete-category-image/{id}','CategoryController@deleteCategoryImage');

3) Create deleteCategoryImage Function:-
Create deleteCategoryImage function at CategoryController where we will get category image from category id and will delete category image from categories table and from a folder as well.

Now we are able to delete category image both from the folder and the database.

►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