wearefar / laravel-ecommerce
A Laravel package to build a simple ecommerce
Requires
- php: ^7.4|^8.0
- livewire/livewire: ^2.5
- stripe/stripe-php: ^7.93
- symfony/intl: ^5.3
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
README
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.