action == "save" and $file = $fileRepository->find(request()->file)) { if ($file->extension === 'xls' || $file->extension === 'xlsx') { $pathToFolder = "/storage/streams/default/files-module/local/ads_excel/"; Excel::import(new AdvsImport(), base_path() . $pathToFolder . $file->name); $this->messages->success(trans('streams::message.create_success', ['name' => trans('module::addon.title')])); } } //Form Render $builder->setFields([ 'file' => [ "type" => "anomaly.field_type.file", "config" => [ 'folders' => ["ads_excel"], 'mode' => 'upload' ] ], ]); $builder->setActions([ 'save' ]); $builder->setOptions([ 'redirect' => route('visiosoft.module.advs::admin_advs') ]); return $builder->render(); } }