🔗Laravel 12 Multi-Vendor E-commerce Series Complete Playlist:
https://www.youtube.com/playlist?list=PLLUtELdNs2ZZ_hI7DvqrrhX-ASGD1U2Dl
Welcome to Part 32 of the Laravel 12 Multi-Vendor E-commerce Tutorial Series, where we continue developing our robust Multi-Vendor E-commerce platform from scratch.
In this part, we implement the Add/Edit Product form and focus on adding basic product fields in the Products Module. This is a crucial step in managing your store’s inventory efficiently.
🔧 Topics Covered in This Part:
✅ 1) Update products Table via Migration
First, we are going to update products table as we need to add nullable and add default values to some of the columns. Also we need to update column admin_type to admin_role as it looks more meaningful.
✅ 2) Update admins Table data
Also make sure in AdminsTableSeeder to add admin/subadmins
Seeder now includes:
One Admin (Amit Gupta)
Two Subadmins (Steve, John)
All with hashed passwords and necessary roles.
✅ 3) Update categories Table data
Also make sure to add dummy categories/sub categrories via CategoryTableSeeder.
Includes:
Parent categories (e.g., Clothing, Electronics)
Subcategories and nested subcategories (e.g., Men → Men T-Shirts)
Uses Carbon::now() for created_at and updated_at
Default values for SEO fields, description, and status
✅ 4) Run Migration + Seeder
And after updating these files, run below command:
php artisan migrate:fresh --seed
It will re-create all tables and records once again.
Now we will start working to add/edit basic product fields.
✅ 5) Update products.blade.php (Products Listing Page)
Add Product Button shown only if edit_access or full_access is granted.
✅ 6) Resource Route Setup
You added this line inside the admin middleware group in routes/web.php:
Route::resource('products', ProductController::class);
✅ 7) Update ProductController Methods
Show Add Product Form & get categories level to return at Add Product Form
✅ 8) Create add_edit_product.blade.php
We create a single Blade file for both Add and Edit operations with below basic fields right now.
✅9) Create addEditProduct() in ProductService
✅10) Required Header Imports
At the top of your ProductService.php, add:
use App\Models\Product;
use App\Models\AdminsRole;
use App\Models\Category;
use Auth;
Make sure to add below classes at top of ProductController:
use App\Services\Admin\ProductService;
use App\Models\Category;
use App\Models\Product;
use Session;
use Auth;
✅11) Show Success Message in index.blade.php
Display a flash message after successful product add/update.
🔜 In the next part, we will implement drag & drop image and video upload using Dropzone.js for products in the admin panel.
📢 Don’t forget to Like, Share & Subscribe for more Laravel tutorials! 🚀
🔗Bookmark & follow this Laravel 12 Multi-Vendor E-commerce Series:
https://www.youtube.com/playlist?list=PLLUtELdNs2ZZ_hI7DvqrrhX-ASGD1U2Dl
►Click here to subscribe for Laravel & other updates -
https://www.youtube.com/stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel 12 Tutorial (with MySQL):
https://www.youtube.com/playlist?list=PLLUtELdNs2ZbqkUOd-oXHemay3BrsqZqC
►Laravel 11 Tutorial (with MongoDB):
https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTn3ft4BMaAilhZJYLMs9d
►Laravel 11 PostgreSQL Tutorial:
https://www.youtube.com/playlist?list=PLLUtELdNs2ZZy4jI-wu4jYUL7rbvC8Mgh
►Laravel API Tutorial -
https://www.youtube.com/playlist?list=PLLUtELdNs2ZbcCsd4yAAiBU2L3ROREk8P
►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
#Laravel12 #LaravelEcommerce #MultiVendor #EcommerceDevelopment #WebDevelopment #LaravelTutorial
Тэги:
#Laravel_12_Multi_Vendor_E-commerce #Laravel_12_Tutorial #Admin_Login_in_Laravel #Laravel_Service_Layer #Laravel_Admin_Service #Admin_Login_Functionality #Laravel_E-commerce #Multi_Vendor_E-commerce_in_Laravel #Service_Class_in_Laravel #AdminController #AdminService #Laravel_Best_Practices #Laravel_Clean_Code #Laravel_Separation_of_Concerns