#109

Описание к видео #109

In Part-109 of E-com Series, we will continue work on CMS Pages and will work on Add CMS Page functionality in admin panel.

1) Create Route :-
First of all, create GET/POST route for add-cms-page in web.php file like below :-

// Add CMS Route
Route::match(['get','post'],'/admin/add-cms-page','CmsController@addCmsPage');

2) Create addCmsPage function :-
Now create addCmsPage function in CmsController file and return view to add_cms_page blade file that we will create.

3) Create add_cms_page.blade.php file :-
Now create pages folder under views folder in which we will create add_cms_page.blade.php file. Add admin design to it and Add CMS Page form. We can copy the entire add product page and make changes.

4) Update addCmsPage function :-
Now we will update addCmsPage function to receive the post data that contains the cms page details and add query to insert the details into cms_pages table.

5) Add Header Statement :-
Add below statement at top of your CmsController file :-
use App\CmsPage;

You can check in video, we able to insert the cms page into cms_pages table and return back to add cms form for now with success message.

In next video, we are going to display all cms pages and will add update cms page functionality as well.

Thanks for watching :)

Комментарии

Информация по комментариям в разработке