44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Pagination\Paginator;
|
|
use Illuminate\Support\Facades\Vite;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
$this->configureModels();
|
|
Paginator::useBootstrapFive();
|
|
Vite::useStyleTagAttributes(function (?string $src, string $url, ?array $chunk, ?array $manifest) {
|
|
if ($src !== null) {
|
|
return [
|
|
'class' => preg_match("/(resources\/assets\/vendor\/scss\/(rtl\/)?core)-?.*/i", $src) ? 'template-customizer-core-css' :
|
|
(preg_match("/(resources\/assets\/vendor\/scss\/(rtl\/)?theme)-?.*/i", $src) ? 'template-customizer-theme-css' : ''),
|
|
];
|
|
}
|
|
|
|
return [];
|
|
});
|
|
}
|
|
|
|
private function configureModels(): void
|
|
{
|
|
Model::shouldBeStrict(! $this->app->isProduction());
|
|
}
|
|
}
|