#56 Make E-com website in Laravel 5.6 | Home Page Dynamic Slider Banners | Add Banners

Опубликовано: 14 Август 2018
на канале: Stack Developers
2,571
36

In Part-56, we will continue working on Home Page Banners and will make them dynamic at home page from admin panel. In last video, we have done add banner functionality and in this video, we will work on view banners and edit banner functionalities.

For Viewing Banners in Admin Panel :-

1) Create Route :-

Create GET Route for view banners in web.php file like below :-

Route::get('admin/view-banners','BannersController@viewBanners');

2) Create Function :-

Now we will create viewBanners function in BannersController where we will get all the banners and return to view banners blade file.

3) Create view_banners.blade.php file :-

Now we will create view_banners.blade.php file under banners folder and copy content from view products blade file and will make changes there.

Now you have seen in video, View Banners page is ready. Now we will work on editing banners.

For Editing Banners in Admin Panel :-

1) Create Route :-

We will create GET/POST route for editing banner with parameter banner id in web.php :-

Route::match(['get','post'],'/admin/edit-banner/{id}','BannersController@editBanner');

2) Create Function :-

Now we will create editBanner function in BannersController and pass banner id as parameter to get banner details and return to edit banner blade file.

3) Create edit_banner.blade.php file :-

Now we will create edit_banner.blade.php file in banners folder and then we can copy the add_banner content there and make changes in it.

4) Update Function :-

Now we will update editBanner function to get the banner details and update in banners table.

Now you have seen in video, we able to get banners data in editBanner function for editing the banner.

We will continue in next video and complete edit banner functionality and will work on delete banner functionality and will also show the banners at home page dynamically after making the changes at index blade file.. Stay tune...

Thanks for watching :)


Смотрите видео #56 Make E-com website in Laravel 5.6 | Home Page Dynamic Slider Banners | Add Banners онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stack Developers 14 Август 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,57 раз и оно понравилось 3 людям.