diff --git a/app/Http/Controllers/BuildingController.php b/app/Http/Controllers/BuildingController.php index 9c752ab..875b4cb 100644 --- a/app/Http/Controllers/BuildingController.php +++ b/app/Http/Controllers/BuildingController.php @@ -17,7 +17,7 @@ public function create() // TASK: Customize the validation error message to say "Please enter the name" public function store(StoreBuildingRequest $request) { - Building::create($validator->validated()); + Building::create($request->validated()); return 'Success'; } diff --git a/app/Http/Requests/StoreBuildingRequest.php b/app/Http/Requests/StoreBuildingRequest.php index fbd8c06..4b969cf 100644 --- a/app/Http/Requests/StoreBuildingRequest.php +++ b/app/Http/Requests/StoreBuildingRequest.php @@ -30,4 +30,11 @@ public function rules() 'name' => 'required' ]; } + + public function messages() + { + return [ + 'name' => 'Please enter the name', + ]; + } }