September 2017
Intermediate to advanced
244 pages
6h 44m
English
This will trigger the PostController::store() method. The thing we have missed is validation. In fact, Lumen provides us validation support as well as some built-in validation rules. Lumen validation is very similar to Laravel, with some differences. I would suggest that you have a look at Laravel's validation documentation, at https://laravel.com/docs/5.4/validation, and Lumen's validation differences with Laravel: https://lumen.laravel.com/docs/5.4/validation.
Here, we have added validation in store(), so look at the code after adding validation and we will then discuss it:
public function store(Request $request){ $input = $request->all(); $validationRules = [ 'content' => 'required|min:1', 'title' => 'required|min:1', ...
Read now
Unlock full access