In Part-26 of the Laravel 9 Tutorial to create a Multi-Vendor E-commerce Website in Laravel, we will start working on eshop related modules like Sections, Categories, Products, Attributes and so on.
We will first start working on the sections module in which we will add the below sections.
Clothing
Electronics
Appliances
Every section will have its own categories that we will work on later.
Some of the categories that we will add under these sections are as below:-
Clothing - Men, Women, Kids
Electronics - Mobiles, Computers, Televisions, Cameras, Headphones
Appliances - Air Conditioners, Refrigerators, Washing Machines
In this video, we will create a sections table with Migration and will add records into it with Seeding.
We will also create a controller and model for sections.
1) Create sections table:-
First of all, we will create a sections table with migration. Create migration file with name create_sections_table for creating sections table with below columns:-
id, name, status
So, we will run below artisan command to create a migration file for sections:-
php artisan make:migration create_sections_table
Open the create_sections_table migration file and add all required columns mentioned earlier.
Now, we will run below artisan command to create a section table with the required columns:-
php artisan migrate
2) Create Section model:-
Create a Section model by running the below command:-
php artisan make:model Section
3) Create SectionController:-
Create SectionController by running below command :-
php artisan make:controller Admin/SectionController
Now, We will create a Seeding for sections table to insert sections like Men, Women and Kids from a file.
4) Writing Seeder / Create SectionsTableSeeder file :-
First of all, we will generate a seeder and create a SectionsTableSeeder file where we will add records for the sections table.
Run below artisan command to generate Seeder and create SectionsTableSeeder file:-
php artisan make:seeder SectionsTableSeeder
The above command will create SectionsTableSeeder.php file at \database\seeds\
Now open the SectionsTableSeeder file and add a record for the section.
5) Update DatabaseSeeder.php file:-
Now update DatabaseSeeder.php file located at database/seeds/ to add SectionsTableSeeder class as shown in video.
6) Run the below command:-
Now run the below command that will finally insert records into the sections table.
php artisan db:seed
In the next video, we will display sections in the admin panel and will also work on enable/disable and delete functionality.
►Laravel 9 Tutorial (Create Multi-Vendor E-commerce Website) - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTlQ97V1Tl8mirS3qXHNFZ
►Get Ready for Laravel 9 - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYVb9lco6OnloSFyBLZU3tz
►Click here to subscribe for Laravel & other updates - https://www.youtube.com/stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZaHaFmydqjcQ-YyeQ19Cd6u
►GIT Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZVQ-dLOMFWvmCCduzJ8c6R
►Laravel API Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbcCsd4yAAiBU2L3ROREk8P
►Laravel Interview Questions - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbzB_1Jdp_yFcORwOfWP8RU
►jQuery Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbMYoUA46GIonOH29KcjtxA
►Laravel Basic E-commerce Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZY5drPxIWzpq5crhantlzp7
►Laravel Dating Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZrPUnxjlomErJfNvkyS6Hf
►Join this channel to get the complete source code of all series:
https://www.youtube.com/channel/UCExO2i-tLU1NyVZD6zOJQlw/join
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - http://facebook.com/stackdevelopers2/
►Join Facebook Group to resolve your queries - http://facebook.com/groups/stackdevelopers
►Follow on Instagram - https://www.instagram.com/stackdevelopers2/
►Follow on GitHub - https://github.com/stackdevelopers
#laravel9 #laravel9tutorial #laravel
We will first start working on the sections module in which we will add the below sections.
Clothing
Electronics
Appliances
Every section will have its own categories that we will work on later.
Some of the categories that we will add under these sections are as below:-
Clothing - Men, Women, Kids
Electronics - Mobiles, Computers, Televisions, Cameras, Headphones
Appliances - Air Conditioners, Refrigerators, Washing Machines
In this video, we will create a sections table with Migration and will add records into it with Seeding.
We will also create a controller and model for sections.
1) Create sections table:-
First of all, we will create a sections table with migration. Create migration file with name create_sections_table for creating sections table with below columns:-
id, name, status
So, we will run below artisan command to create a migration file for sections:-
php artisan make:migration create_sections_table
Open the create_sections_table migration file and add all required columns mentioned earlier.
Now, we will run below artisan command to create a section table with the required columns:-
php artisan migrate
2) Create Section model:-
Create a Section model by running the below command:-
php artisan make:model Section
3) Create SectionController:-
Create SectionController by running below command :-
php artisan make:controller Admin/SectionController
Now, We will create a Seeding for sections table to insert sections like Men, Women and Kids from a file.
4) Writing Seeder / Create SectionsTableSeeder file :-
First of all, we will generate a seeder and create a SectionsTableSeeder file where we will add records for the sections table.
Run below artisan command to generate Seeder and create SectionsTableSeeder file:-
php artisan make:seeder SectionsTableSeeder
The above command will create SectionsTableSeeder.php file at \database\seeds\
Now open the SectionsTableSeeder file and add a record for the section.
5) Update DatabaseSeeder.php file:-
Now update DatabaseSeeder.php file located at database/seeds/ to add SectionsTableSeeder class as shown in video.
6) Run the below command:-
Now run the below command that will finally insert records into the sections table.
php artisan db:seed
In the next video, we will display sections in the admin panel and will also work on enable/disable and delete functionality.
►Laravel 9 Tutorial (Create Multi-Vendor E-commerce Website) - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTlQ97V1Tl8mirS3qXHNFZ
►Get Ready for Laravel 9 - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYVb9lco6OnloSFyBLZU3tz
►Click here to subscribe for Laravel & other updates - https://www.youtube.com/stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZaHaFmydqjcQ-YyeQ19Cd6u
►GIT Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZVQ-dLOMFWvmCCduzJ8c6R
►Laravel API Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbcCsd4yAAiBU2L3ROREk8P
►Laravel Interview Questions - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbzB_1Jdp_yFcORwOfWP8RU
►jQuery Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbMYoUA46GIonOH29KcjtxA
►Laravel Basic E-commerce Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZY5drPxIWzpq5crhantlzp7
►Laravel Dating Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZrPUnxjlomErJfNvkyS6Hf
►Join this channel to get the complete source code of all series:
https://www.youtube.com/channel/UCExO2i-tLU1NyVZD6zOJQlw/join
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - http://facebook.com/stackdevelopers2/
►Join Facebook Group to resolve your queries - http://facebook.com/groups/stackdevelopers
►Follow on Instagram - https://www.instagram.com/stackdevelopers2/
►Follow on GitHub - https://github.com/stackdevelopers
#laravel9 #laravel9tutorial #laravel
- Catégories
- E commerce Affiliations
Commentaires