/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { //id del usuario logueado $id_logueado = Auth::user()->id; if (Auth::user()->nivel === 'cliente') { return redirect('inicioCliente'); } elseif (Auth::user()->nivel === 'tecnico') { $servicio = Servicio::where('tecnico_id', $id_logueado)->orderBy('id', 'DESC')->paginate(5); } else { $servicio = Servicio::orderBy('id', 'DESC')->paginate(5); } return view('servicios.index')->with('servicio', $servicio); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $servicios = Servicio::orderBy('created_at', 'desc')->paginate(15); return view("servicios.index", compact("servicios")); }
public function index() { $servicios = Servicio::orderBy('id', 'ASC')->paginate(5); return view('admin.servicios.index')->with('servicios', $servicios); }