wip uni file manager
This commit is contained in:
1 parent
51e2659a1e
commit
8eaead42e6
9 files changed
+605
-352
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Filament\Resources\Events\Pages\ListEvents;
|
||||
use App\Models\User;
|
||||
use BezhanSalleh\FilamentShield\Facades\FilamentShield;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Notifications\Livewire\Notifications;
|
||||
@@ -17,7 +18,9 @@ use Filament\Support\Facades\FilamentTimezone;
|
||||
use Filament\Support\Facades\FilamentView;
|
||||
use Filament\Tables\View\TablesRenderHook;
|
||||
use Filament\View\PanelsRenderHook;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -36,6 +39,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
|
||||
Gate::define('manageFileManager', function (User $user): bool {
|
||||
return Auth::user()->hasRole('super_admin') ?? false;
|
||||
});
|
||||
|
||||
FilamentShield::enforcePolicies();
|
||||
|
||||
FilamentTimezone::set('Europe/Vienna');
|
||||
|
||||
@@ -38,6 +38,7 @@ use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Swis\Filament\Backgrounds\FilamentBackgroundsPlugin;
|
||||
use Swis\Filament\Backgrounds\ImageProviders\MyImages;
|
||||
use UniFileManager\FilamentFileManager\FilamentFileManagerPlugin;
|
||||
|
||||
class AdminPanelProvider extends PanelProvider
|
||||
{
|
||||
@@ -51,6 +52,13 @@ class AdminPanelProvider extends PanelProvider
|
||||
RecordUserActivity::class,
|
||||
])
|
||||
->userMenuItems([
|
||||
Action::make('file-exchange') // Give your action a unique name/ID
|
||||
->label('File Exchange')
|
||||
->color('warning')
|
||||
->visible(fn (): bool => Auth::user()->hasRole('super_admin'))
|
||||
->url('https://file.statistiko.at/', shouldOpenInNewTab: true)
|
||||
->icon('heroicon-o-arrow-top-right-on-square')
|
||||
->visible(true),
|
||||
ExportAction::make('download_betfair')
|
||||
->columnMapping(false)
|
||||
->exporter(BetfairExporter::class)
|
||||
@@ -180,6 +188,12 @@ class AdminPanelProvider extends PanelProvider
|
||||
->authMiddleware([
|
||||
Authenticate::class,
|
||||
])->plugins([
|
||||
FilamentFileManagerPlugin::make()
|
||||
->navigationLabel('Files')
|
||||
// ->navigationGroup('Data')
|
||||
->navigationSort(10)
|
||||
->navigationIcon('heroicon-o-folder'),
|
||||
// ->shouldRegisterNavigation(fn (): bool => Auth::user()->hasRole('super_admin') ?? false),
|
||||
FilamentShieldPlugin::make()
|
||||
->navigationGroup('User')
|
||||
->navigationSort(10)
|
||||
|
||||
Reference in new issue
Block a user