if i have a searchable value and other records are chaining on it , in edit form the chained values are not presented in the request because the the main Chain::as is eager loaded : ex
Chain::as('user', function () {
return [
SearchableSelect::make('User', 'user_id')->resource("users")
->rules('required')
->displayUsingLabels()
];
}),
Chain::with('user.user_id', function ($request) {
if ($request->user_id) {
return [
Select::make('User Car', 'car_id')
->options(
\App\UserCar::where('user_id', $request->user_id)->pluck('plate_number', 'id')->toArray()
)
];
}
return [];
}, 'car'),
Chain::with('car.car_id', function ($request) {
if ($request->car_id) {
$car = \App\UserCar::find($request->car_id);
return [
Multiselect::make('Services')
->options(
MaintenanceServiceVehicleModel::where('vehicle_model_id', $car->vehicle_model_id)->with('serviceType')->get()->mapWithKeys(function ($item) {
return [$item['id'] => $item['serviceType']['title_en']];
})->toArray()
),
];
}
return [];
}),
in this example , in the edit form , only the user_id are presented in the request and not the other fields
if i have a searchable value and other records are chaining on it , in edit form the chained values are not presented in the request because the the main Chain::as is eager loaded : ex
in this example , in the edit form , only the user_id are presented in the request and not the other fields