file('file'); if ($file && $file->isValid()) { $pathUrl = $path == '' ? '/uploads/'.$type.'/'.date('Ymd').'/'.md5($file->getUploadName().time()).'.'.$file->getUploadExtension() : $path; $fullPathUrl = public_path().$pathUrl; $file->move($fullPathUrl); $data = [ 'file_url' => $pathUrl, 'full_url' => getenv('MAIN_DOMAIN').$pathUrl ]; return $data; } return false; } }