I'm new to Laravel and trying to soft-delete both rows from two tables.
Vehicles table,
Taken_bies table,
In vehicles table, if is_taken
is true, I grab the id of vehicle and fill it to vehicle_id
from taken_bies table with other information.
In my TakenBy model, I've implemented relationship as follow:
public function vehicle() {
return $this->belongsTo('App\Vehicle');
}
My Requiremnet:
If I soft-delete the vehicle, I want to delete the related taken_bies information from taken_bies table. How can I achieve that? I'm using Laravel 5.8. Thank you.