Level 6
In bootstrapp/app do you have the withFacades commented out? I believe that would cause this type of error.
$app->withFacades();
<?php
namespace App\Http\Controllers;
use Validator;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class FormController extends Controller {
/**
* Get user login.
*
* @return Response
*/
public function get() {
return view('FormView', ['path' => url('form')]);
}
/**
* Validate and show input.
*
* @param Request $request
* @return Response
*/
public function show(Request $request) {
$validator = Validator::make($request->all(), [
'title' => 'required|unique:posts|max:255',
'body' => 'required',
]);
if ($validator->fails()) {
return redirect('post/create')
->withErrors($validator)
->withInput();
}
}
}
Fatal error: Class 'Validator' not found in C:\xampp\htdocs\project\app\Http\Controllers\FormController.php on line 25
Where the problem is?
In bootstrapp/app do you have the withFacades commented out? I believe that would cause this type of error.
$app->withFacades();
Please or to participate in this conversation.