schema([ FileUpload::make('file') ->label(__('admin.common.csv_file')) ->acceptedFileTypes(['text/csv', 'text/plain']) ->directory('imports') ->required(), ]); } public function doImport(): void { $this->validate(); $path = $this->form->getState()['file'] ?? null; if (! $path || ! Storage::disk('public')->exists($path)) { Notification::make()->danger()->title(__('admin.notifications.file_not_found'))->send(); return; } $fullPath = Storage::disk('public')->path($path); [$ok, $fail] = app(EmotionImportService::class)->import($fullPath); Notification::make() ->success() ->title(__('admin.notifications.imported_rows', ['count' => $ok])) ->body($fail ? __('admin.notifications.failed_count', ['count' => $fail]) : null) ->send(); } public function getHeading(): string { return __('admin.emotions.import.heading'); } }