bind('media-library-helpers', fn () => collect([])); app()->singleton(CollectionExtension::class, fn () => new CollectionExtension()); } public function boot(): void { app(Router::class)->group($this->routeGroup(), function ($router) { $router->post('mediaupload', [MediaController::class, 'store'])->name('media.store'); $router->delete('mediaupload/{media}', [MediaController::class, 'destroy'])->name('media.destroy'); $router->get('mediaupload/{parent_model}/{parent_id}/{collection}', [MediaController::class, 'index'])->name('media.index'); }); app(CollectionExtension::class)->boot(); } /** * @return array{middleware: array} */ protected function routeGroup(): array { return [ 'middleware' => config('medialibrary-helper.middleware'), ]; } }