Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $empresas = Empresa::with('servicios')->get();
     return $empresas;
 }
Пример #2
0
 public function getAllConductores($id)
 {
     $conductores = Empresa::with('conductores.central', 'conductores.central.ciudad', 'conductores.vehiculo')->find($id)->conductores;
     //        foreach ($conductores as &$conductor) {
     //            $con
     //            if($conductor->central) {
     //                $conductor->central->load('ciudad');
     //            }
     //        }
     return $conductores;
 }