Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

orchidsoftware/platform

4733 stars
3 code files
View orchidsoftware/platform on GitHub

src/Platform/Providers/PlatformServiceProvider.php

Open in GitHub
use 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 GitHub
use 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"
],
//
}
},
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.