function getExample6() { //UPDATE $item = new Item(); $item = $item->find(41); dump($item->toArray()); $items = Item::all(); dump($items->toArray()); }
public function getReject($item_id) { //Check if this is an authorized organizer if (\Auth::user()->role == 'Organizer') { $item = Item::find($item_id); if (is_null($item)) { \Session::flash('flash_message', 'item not found.'); return redirect('/items'); } $item->status = 'Rejected'; $item->save(); \Session::flash('flash_message', "Item " . $item->name . ' was rejected.'); return redirect('/items'); } }