Ejemplo n.º 1
0
 public function bidOnItem($itemId)
 {
     $userId = Auth::id();
     $authModel = config('auth.model');
     $user = with(new $authModel())->with(['bid'])->find($userId);
     if (empty($user) || empty($user->bid)) {
         throw new Exception(sprintf('User ID %d failed to bid on item ID %d', $userId, $itemId));
         return false;
     }
     $item = Item::where('id', $itemId)->firstOrFail();
     dd($item->id);
 }
Ejemplo n.º 2
0
 public function getAllCurrentListings()
 {
     return Item::where('active', 1)->get();
 }