| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace Longyi\FrontMenu\Providers;
- use Illuminate\Support\Facades\Blade;
- use Illuminate\Support\ServiceProvider;
- class FrontMenuServiceProvider extends ServiceProvider
- {
- /**
- * Register services.
- */
- public function register(): void
- {
- // Merge the front menu admin item into the `menu.admin` config so it
- // appears under the existing "Settings" menu (key prefixed with "settings.").
- $this->mergeConfigFrom(__DIR__ . '/../Config/menu.php', 'menu.admin');
- // Register ACL permissions so the menu item is visible to admin users.
- $this->mergeConfigFrom(__DIR__ . '/../Config/acl.php', 'acl');
- }
- /**
- * Bootstrap services.
- */
- public function boot(): void
- {
- $this->loadRoutesFrom(__DIR__ . '/../Routes/admin-routes.php');
- $this->loadViewsFrom(__DIR__ . '/../Resources/views', 'frontmenu');
- $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'frontmenu');
- $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
- Blade::anonymousComponentPath(__DIR__ . '/../Resources/views/admin/menu/partials', 'frontmenu');
- $this->publishes([
- __DIR__ . '/../Resources/views' => resource_path('views/vendor/longyi/frontmenu'),
- ], 'frontmenu-views');
- $this->publishes([
- __DIR__ . '/../Database/Seeders' => database_path('seeders'),
- ], 'frontmenu-seeds');
- if ($this->app->runningInConsole()) {
- $this->commands([
- \Longyi\FrontMenu\Console\Commands\InitializeFrontMenu::class,
- ]);
- }
- }
- }
|