I am just about to ask, By Using this approach I can easily see there are three (3)
times call to server, So if I use in Model to Do that something like:
$this->subTown()->delete(); parent::someFunction(); // not the actual code
is there also three (3) calls to server behind the scene or Model will do the
same task only in One (1) Call.....!
because i wrote this code in controller rather than Model
I have used my approach to delete the two Relations or Hierarchy for this
situation like
City could have many Towns & Towns also could have many Sub-towns so when
Deleting the City than call this piece of code in controller's function
$id = Input::get('id'); //return response()->json($id);
$obj = SubTown::where('city_id',$id)->delete();
$objj = Town::where('city_id', $id)->delete();
$ok= City::find($id)->delete();
its working fine but i want to know the best approach.
can any one guide me in best way because According to mine its calling three times to server.
thanks in advance