예제 #1
0
 private function postAddItemStepOne(ItemRequest $request)
 {
     $step = 2;
     //Get all selected markets with the defaultAttributes
     foreach ($request->input('markets') as $marketID => $boolean) {
         if ($boolean) {
             $selectedMarkets[] = Market::with('defaultAttributes')->where('id', $marketID)->first();
         }
     }
     //Set <title>
     $title = 'Add item';
     //Set Auth::check()
     $loggedIn = $this->loggedIn;
     //Get the markets for the nav and where to place item in
     $markets = $this->markets;
     //Return view item/add
     return view('item.add', compact('title', 'loggedIn', 'markets', 'step', 'selectedMarkets'));
 }
예제 #2
0
 /**
  * Create a new item.
  * Sync Tags
  */
 private function createItem(ItemRequest $request)
 {
     $item = \Auth::user()->items()->create($request->all());
     if (!empty($request->input('tag_list'))) {
         $this->syncTags($item, $request->input('tag_list'));
     }
     return $item;
 }