How validation works in laravel