Build your own ecommerce store with FilamentPHP with the Power of Tomato CMS Builder
composer require tomatophp/filament-ecommerce
we need the Media Library plugin to be installed and migrated you can use this command to publish the migration
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-migrations"
now you need to install the settings hub use these commands
php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"php artisan filament-settings-hub:install
then you need to publish the account model
php artisan vendor:publish --tag="filament-accounts-model"
after installing your package please run this command
php artisan filament-ecommerce:install
finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php
->plugin(\TomatoPHP\FilamentEcommerce\FilamentEcommercePlugin::make())
you can use coupon service to check if coupon is valid or not
you can use this method to check for selected Order
use \TomatoPHP\FilamentEcommerce\Facades\FilamentEcommerce;Â FilamentEcommerce::coupon()->check('coupon_code', \TomatoPHP\FilamentEcommerce\Models\Order::find(1));
or you can check the code for selected products
use \TomatoPHP\FilamentEcommerce\Facades\FilamentEcommerce;Â FilamentEcommerce::coupon()->products([1,2,4])->check('coupon_code');
or you can get the direct discount amount of the code
use \TomatoPHP\FilamentEcommerce\Facades\FilamentEcommerce;Â FilamentEcommerce::coupon()->products([1,2,4])->discount('coupon_code');
and it's the same as check you can apply to selected order or selected products.
you can publish config file by use this command
php artisan vendor:publish --tag="filament-ecommerce-config"
you can publish views file by use this command
php artisan vendor:publish --tag="filament-ecommerce-views"
you can publish languages file by use this command
php artisan vendor:publish --tag="filament-ecommerce-lang"
you can publish migrations file by use this command
php artisan vendor:publish --tag="filament-ecommerce-migrations"
Checkout our Awesome TomatoPHP