Above is the result of dd() one of the object , right now what i did is
//$car is a object variable
$car->corporate_id = some_function($car->corporate_id);
$car->corporate_name = some_function($car->corporate_name);
$car->member_id = some_function($car->member_id);
Instead doing the above ways , how can i achieve something like
$data = some_function($car);
//it will go through all $car properties and run the same validation
can someone tell me how to achieve this?