This package provides a modular way to manage products for your Laravel webshop. It is designed to be simple, extendable, and easily integrated into existing Laravel projects.
- Product model with Eloquent support
- Easy CRUD operations for products
- Migration and configuration publishing
- Extendable for custom features
Require the package via Composer:
composer require veiliglanceren/laravel-webshop-product
To publish configuration, migrations, and other assets:
php artisan vendor:publish --provider="VeiligLanceren\LaravelWebshopProduct\ProductServiceProvider"
Run the migrations to create the necessary tables:
php artisan migrate
Use the provided Product
model directly or extend it:
use VeiligLanceren\LaravelWebshopProduct\Models\WebshopProduct;
$products = WebshopProduct::all();
// Create
$product = WebshopProduct::create([
'name' => 'Example WebshopProduct',
'price' => 99.99,
'sku' => 'example-product'
]);
// Read
$product = WebshopProduct::find(1);
// Update
$product->update([
'price' => 89.99,
]);
// Delete
$product->delete();
Table | Columns |
---|---|
webshop_products |
id , name , slug , sku , price , description , is_visible , order , timestamps |
webshop_product_images |
id , product_id , url , alt_text , is_primary , order , timestamps |
webshop_product_variants |
id , product_id , name , sku , price , stock , is_default , order , timestamps |
These tables support full product management, media handling, variant selection, and categorization using a polymorphic relationship.
You can extend the Product
model or override views, controllers, and routes to fit your webshop needs.
If you published the config file, you can customize package settings in:
config/product.php
Run tests with PHPUnit:
php artisan test
Contributions, issues, and feature requests are welcome. Please follow the repository guidelines.
This package is open-sourced software licensed under the MIT license.