36 lines
1021 B
PHP
36 lines
1021 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\View\Composers\TaxDropdown;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Translation\Translator;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
if ($this->app->environment() === 'local') {
|
|
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
|
|
$this->app->register(TelescopeServiceProvider::class);
|
|
|
|
$this->app->extend('translator', function (Translator $translator) {
|
|
$trans = new \App\Translator($translator->getLoader(), $translator->getLocale());
|
|
$trans->setFallback($translator->getFallback());
|
|
return $trans;
|
|
});
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
\Illuminate\Support\Facades\View::composer('components.tax-dropdown', TaxDropdown::class);
|
|
}
|
|
}
|