| Install | |
|---|---|
composer require nickdekruijk/shopwire |
|
| Latest Version: | 0.2.10 |
| PHP: | ^8.1 |
A simple, easy to implement shopping cart and checkout package for Laravel 9 using Livewire.
To install run the following command:
composer require nickdekruijk/shopwire
Before your run php artisan migrate make sure your Product model is properly setup.
Publish the config file with:
php artisan vendor:publish --tag=config --provider="NickDeKruijk\Shopwire\ShopwireServiceProvider"
Add ShopwireProduct trait:
use NickDeKruijk\Shopwire\Traits\ShopwireProduct;
class Product extends Model
{
use ShopwireProduct;
If your model is different from the default (App\Models\Product), you can change the model name in the config file.
Afterwards run the migration command:
php artisan migrate
To enable automatic country detection, add the following to your .env file:
LOCATION_TESTING=false
By defaults Shopwire uses Mollie as payment provider, set your Mollie API key in the .env file:
MOLLIE_KEY=test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
To make the payment provider webhooks work you may need to update the $except array in app\Http\Middleware\VerifyCsrfToken.php
protected $except = [
'shopwire/payment/webhook',
];
You need to make a logging channel called shopwire, add something like this to config/logging.php:
'shopwire' => [
'driver' => 'single',
'path' => storage_path('logs/shopwire.log'),
'level' => 'debug',
],
To manage products/vat/orders etc with the nickdekruijk/admin package add the modules as described in this example file to your config/admin.php file.
Dutch VAT
php artisan db:seed --class=NickDeKruijk\\Shopwire\\Seeds\\VatDutch
Dutch Shipment methods
php artisan db:seed --class=NickDeKruijk\\Shopwire\\Seeds\\ShippingDutch
Shopwire is open-sourced software licensed under the MIT license.