mirror of
https://github.com/anna-sara/filament_inventory
synced 2025-10-26 20:17:14 +01:00
46 lines
1 KiB
PHP
46 lines
1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Vite;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use BezhanSalleh\FilamentLanguageSwitch\LanguageSwitch;
|
|
use Filament\Support\Colors\Color;
|
|
use Filament\Support\Facades\FilamentColor;
|
|
use Illuminate\Support\Facades\Gate;
|
|
use App\Models\User;
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Vite::prefetch(concurrency: 3);
|
|
|
|
LanguageSwitch::configureUsing(function (LanguageSwitch $switch) {
|
|
$switch
|
|
->locales(['en','sv']); // also accepts a closure
|
|
});
|
|
|
|
FilamentColor::register([
|
|
'primary' => Color::hex('#0080bb'),
|
|
]);
|
|
|
|
Gate::define('viewPulse', function (User $user) {
|
|
if ($user->is_admin ) {
|
|
return true;
|
|
};
|
|
});
|
|
}
|
|
}
|