Q: Array laravel validation " * " returns true I'm trying to validate an array 
Array :
location_id: [
     {id: 1, name: "Line 1"}, 
     {id: 2, name: "Line 2"}, 
     {id: 3, name: "Flex 1"}, 
     {id: 4, name: "Flex 2"}
],
name: "Failure 1",
station_id: [
     {id: 1, name: "Station 1"}, 
     {id: 2, name: "Station 2"}
]

when the data is sent to the server it returns true 
validation code:
 $rules = [
     'location_id.*.id'  =>  'required',
     'station_id.*.id'  =>   'required'
 ];

 Validator::make($request->all(),$rules)->passes());

it should return false if the array location_id is empty or location_id[0].id == null but is returning true if the array is sent empty
if the rules are specified in the following way it works but sometimes i will add 2,3 or more arrays inside a location_id or station_id
 $rules = [
     'location_id.0.id'  =>  'required',
     'station_id.0.id'  =>   'required'
 ];


A: Try this rule
$rules = [
     'location_id'  =>  'required|array|min:1',
     'location_id.*.id'  =>   'required',
     'station_id.*.id'  =>   'required'
];

Add 'station_id'  =>  'required|array|min:1' to $rules if you want to return false if station_id is empty.
