51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Helpers\DBHelper;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\View;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
View::composer(
|
|
'partials.components.currency-select', 'App\Http\ViewComposers\CurrencySelectViewComposer'
|
|
);
|
|
|
|
View::composer(
|
|
'partials.components.date-select', 'App\Http\ViewComposers\DateSelectViewComposer'
|
|
);
|
|
|
|
View::composer(
|
|
'partials.check', 'App\Http\ViewComposers\InstanceViewComposer'
|
|
);
|
|
|
|
if (config('database.use_utf8mb4')
|
|
&& DB::connection()->getDriverName() == 'mysql'
|
|
&& ! DBHelper::testVersion('5.7.7')) {
|
|
Schema::defaultStringLength(191);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
if (config('telescope.enabled')) {
|
|
$this->app->register(TelescopeServiceProvider::class);
|
|
}
|
|
}
|
|
}
|