rowRules()), 'product'); } /** * Import the rows of an uploaded sheet. */ public function store(ImportProductRequest $request, StoreProduct $action): RedirectResponse { $written = Importer::import( $request->spreadsheet(), ProductColumns::make(), $request->rowRules(), static fn (array $attributes) => $action->handle($attributes), ); Inertia::flash('toast', [ 'type' => $written > 0 ? 'success' : 'error', 'message' => $written > 0 ? trans_choice('crud.imported', $written) : __('crud.import_empty'), ]); return back(); } }