app/Http/Controllers/OficinaController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request,$cliente_id)
    {
        $oficinas=Oficina::where('cliente_id',$cliente_id)->with('ciudad')->get();
        return response()->json(compact('oficinas'));
    }
public function index ( Request $ request , $ cliente_id ) { $ oficinas = Oficina :: where ( 'cliente_id' , $ cliente_id ) -> with ( 'ciudad' ) -> get ( ) ; return response ( ) -> json ( compact ( 'oficinas' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .