wearefar/laravel-ecommerce

A Laravel package to build a simple ecommerce

v0.1.0 2022-07-25 19:42 UTC

This package is auto-updated.

Last update: 2024-04-15 12:08:16 UTC


README

Latest Version on Packagist Total Downloads

A Laravel package to build a simple ecommerce.

Installation

You can install the package via composer:

composer require wearefar/laravel-ecommerce

You can publish and run the migrations with:

php artisan vendor:publish --provider="WeAreFar\Ecommerce\EcommerceServiceProvider" --tag="migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="WeAreFar\Ecommerce\EcommerceServiceProvider" --tag="config"

This is the contents of the published config file:

return [
];

Add the path to the template files in your tailwind.config.js file.

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    './vendor/wearefar/ecommerce/resources/views/**/*.blade.php',
    ...
  ],
  ...
}

You can customize the views by exporting them to your resources/views/vendor directory using the vendor:publish command:

php artisan vendor:publish --provider="WeAreFar\Ecommerce\EcommerceServiceProvider" --tag="views"

Preparing your model

To connect the shop with a model, the model must implement the following interface and trait:

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use WeAreFar\Ecommerce\HasOrders;
use WeAreFar\Ecommerce\OrderItem;

class Product extends Model implements OrderItem
{
    use HasOrders;
}

Exclude webook endpoint from CSRF

protected $except = [
    'stripe/webhook',
];

Usage

// WIP

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you've found a bug regarding security please mail victor@wearefar.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.