files->store(sprintf('public/product-exports/user/%s/%s/', auth()->user()->id, now()->format('H_i_d_m_Y'))); Excel::import(new ProductImport($fields->channel_id), $file); } /** * Get the fields available on the action. * * @return array */ public function fields(NovaRequest $request) { return [ Select::make(__('Channel'), 'channel_id') ->fullWidth() ->displayUsingLabels() ->searchable() ->options(function () { if (auth()->user()->isAdmin()) { return ChannelRepository::values(); } $channel = auth()->user()->channel(); return [$channel->id => $channel->name]; }) ->rules('required'), File::make(__('Products excel'), 'files') ->fullWidth() ->rules('required'), ]; } }