Class 'App\Http\Controllers\Validator' not found
use Illuminate\Support\Facades\Validator;
Class 'App\Http\Controllers\Validator' not found
use Illuminate\Support\Facades\Validator;
message "Class 'Input' not found"
Input facade definition from config/app.php hence you have to manually add that in to aliases array as below,
'Input' => Illuminate\Support\Facades\Input::class,
Or You can import Input facade directly as required,
use Illuminate\Support\Facades\Input;
Class 'App\Http\Controllers\Validator' not found
public function store()
{
$rules = array(
'name' => 'required',
);
$validator = Validator::make(Input::all(), $rules);
// if the validator fails, redirect back to the form
if ($validator->fails()) {
return Redirect::back()
->withErrors($validator) // send back all errors to the login form
->withInput();
$input = input::all();
} else {
$company = New Company();
$company->name = Input::get('name');
$company->user_id = Input::get('user_id');
$company->country_id = Input::get('country_id');
$company->description = Input::get('description');
$company->save();
return Redirect::to('/backend')->withInput()->with('success', Company added.');
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us