nickdekruijk/shopwire

A simple, easy to implement shopping cart and checkout package for Laravel 9 using Livewire.

dev-master 2022-03-02 10:17 UTC

This package is auto-updated.

Last update: 2022-06-30 11:02:59 UTC


README

Latest Stable Version Latest Unstable Version Monthly Downloads Total Downloads License

Shopwire

A simple, easy to implement shopping cart and checkout package for Laravel 9 using Livewire.

Installation

To install run the following command: composer require nickdekruijk/shopwire

Afterwards run the migration command: php artisan migrate

Publish the config file with: php artisan vendor:publish --tag=config --provider="NickDeKruijk\Webshop\ServiceProvider"

Prepare your Product model

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.

Environment

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

Webhooks and Csrf

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',
    ];

Admin package integration

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.

Some seeds with data to start with

Dutch VAT php artisan db:seed --class=NickDeKruijk\\Shopwire\\Seeds\\VatDutch

Dutch Shipment methods php artisan db:seed --class=NickDeKruijk\\Shopwire\\Seeds\\ShippingDutch

License

Shopwire is open-sourced software licensed under the MIT license.