Laravel 5.5 validating hasMany relationship Laravel 5.5 validating hasMany relationship laravel laravel

Laravel 5.5 validating hasMany relationship


Laravel provide a nice way to validate arrays inpputs.

Here is an example

$validator = Validator::make($request->all(), [        'ProdutoAtributos.*.tipo' => 'required',    ]);

You can read more about it here

https://laravel.com/docs/5.6/validation#validating-arrays