public function index()
 {
     // This view changes dependin on the type of user
     $user_id = Auth::user()->id;
     $user_type = Auth::user()->getOriginal('user_type');
     if ($user_type == 'cus') {
         $offers = Offer::where('user_id', $user_id)->get();
     } else {
         $offers = Offer::all();
     }
     $total = count($offers);
     return view('offer.index', compact('offers', 'total'));
 }
 public function getOffers(Request $request)
 {
     if ($request->input('id') == null) {
         $offers = Offer::all();
         return view('home.offers')->with('offers', $offers);
     } else {
         $offer = Offer::where('id', $request->input('id'))->first();
         if ($offer == null) {
             return redirect('offers');
         }
         return view('home.offer')->with('offer', $offer);
     }
 }
 public function getIndex()
 {
     $offers = Offer::all();
     return view('admin.offer.offers')->with('offers', $offers);
 }
Esempio n. 4
0
 public function index()
 {
     return Offer::all();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $offers = Offer::all();
     return view('backend.offers.manage', compact('offers'));
 }
Esempio n. 6
0
 /**
  * Display a listing of all Brands.
  *
  * @return View
  */
 public function index()
 {
     $offers = Offer::all();
     return view('offers.index', compact('offers'));
 }