app->bind(FileAdapterInterface::class, function ($app, array $params) { $disk = $params['disk'] ?? 'local'; return match ($disk) { 'local' => new LocalFileAdapter(Storage::disk($disk)), default => throw new InvalidArgumentException("No FileAdapterInterface available for disk \"{$disk}\"."), }; }); } public function boot(): void { // Signed-URL auth only, same model as Shipping\Http\Controllers\ // DownloadShipmentLabelController — see that route's own docblock. // Migrations live in the shared database/migrations directory // CoreServiceProvider already loads; nothing more to register here. $this->loadRoutesFrom(__DIR__.'/../File/routes/web.php'); Event::listen(CartLineAdded::class, AttachCustomFieldFileToCartLine::class); Event::listen(OrderPlaced::class, TransferCustomFieldFileOwnership::class); if ($this->app->runningInConsole()) { $this->commands([PruneUnownedFilesCommand::class]); } } }