user()->isAdmin(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = [ 'migration' => [], ]; /** We'll skip mime validation while running tests. */ if(app()->environment() !== 'testing') { $rules['migration'] = ['required', 'mimes:zip']; } return $rules; } }