FleetCart/Themes/Storefront/Providers/StorefrontServiceProvider.php

41 lines
1.5 KiB
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Themes\Storefront\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Modules\Admin\Ui\Facades\TabManager;
use Modules\FlashSale\Entities\FlashSale;
use Themes\Storefront\Admin\StorefrontTabs;
use Themes\Storefront\Http\ViewComposers\LayoutComposer;
use Themes\Storefront\Http\ViewComposers\HomePageComposer;
use Themes\Storefront\Http\ViewComposers\StorefrontTabsComposer;
use Themes\Storefront\Http\ViewComposers\ProductShowPageComposer;
use Themes\Storefront\Http\ViewComposers\ProductIndexPageComposer;
class StorefrontServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
2023-12-03 14:07:47 +00:00
if (!is_null(setting('storefront_active_flash_sale_campaign'))) {
2023-06-11 12:14:03 +00:00
FlashSale::activeCampaign(setting('storefront_active_flash_sale_campaign'));
}
TabManager::register('storefront', StorefrontTabs::class);
View::composer('public.layout', LayoutComposer::class);
View::composer('public.home.index', HomePageComposer::class);
View::composer('public.products.index', ProductIndexPageComposer::class);
View::composer('public.products.show', ProductShowPageComposer::class);
View::composer('admin.storefront.tabs.*', StorefrontTabsComposer::class);
Paginator::defaultView('public.pagination');
}
}