app/Http/Controllers/TipoVisitaController.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)
    {
        $tipos = TipoVisita::where('empresa_id', 0)
            ->orWhere('empresa_id', Auth::user()->empresa_id)
            ->orderBy('tipo')
            ->with('duracion')->get();
        if ($request->is('api/*')) {
            return response()->json(compact('tipos'));
        }
        return view('tipos.index', compact('tipos'));
    }
public function index ( Request $ request ) { $ tipos = TipoVisita :: where ( 'empresa_id' , 0 ) -> orWhere ( 'empresa_id' , Auth :: user ( ) -> empresa_id ) -> orderBy ( 'tipo' ) -> with ( 'duracion' ) -> get ( ) ; if ( $ request -> is ( 'api/*' ) ) { return response ( ) -> json ( compact ( 'tipos' ) ) ; } return view ( 'tipos.index' , compact ( 'tipos' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .