-
src/Platform/Providers/PlatformServiceProvider.php
Open in GitHubuse App\Orchid\PlatformProvider; use Illuminate\Support\ServiceProvider; use Orchid\IconPack\Path; use Orchid\Icons\IconFinder; use Orchid\Platform\Dashboard; use Orchid\Platform\ItemPermission; class PlatformServiceProvider extends ServiceProvider { protected $dashboard; public function boot(Dashboard $dashboard, IconFinder $iconFinder): void { $this->dashboard = $dashboard; $icons = array_merge(['o' => Path::getFolder()], config('platform.icons', [])); foreach ($icons as $key => $path) { $iconFinder->registerIconDirectory($key, $path); } $this->app->booted(function () { $this->dashboard ->registerResource('stylesheets', config('platform.resource.stylesheets')) ->registerResource('scripts', config('platform.resource.scripts')) ->registerPermissions($this->registerPermissionsMain()) ->registerPermissions($this->registerPermissionsSystems()) ->addPublicDirectory('orchid', Dashboard::path('public/')); }); } protected function registerPermissionsMain(): ItemPermission { return ItemPermission::group(__('Main')) ->addPermission('platform.index', __('Main')); } protected function registerPermissionsSystems(): ItemPermission { return ItemPermission::group(__('System')) ->addPermission('platform.systems.attachment', __('Attachment')); } public function register() { if (class_exists(PlatformProvider::class)) { $this->app->register(PlatformProvider::class); } } }
-
src/Platform/Providers/FoundationServiceProvider.php
Open in GitHubuse Illuminate\Support\ServiceProvider; class FoundationServiceProvider extends ServiceProvider { // public function provides(): array { return [ // PlatformServiceProvider::class, ]; } // }
-
composer.json
Open in GitHub{ // "extra": { "laravel": { "providers": [ "Orchid\\Platform\\Providers\\FoundationServiceProvider" ], // } }, // }