public function getNew()
    {
        $categories = Category::leaves()->orderBy('category_id')->get();

        if (!session()->has('photos')) {
            $session_photos = [];
        } else {
            foreach (session('photos') as $session_photo) {
                $session_photos[] = \Hamjoint\Mustard\Media\Photo::find($session_photo['photo_id']);
            }
        }

        return view('mustard::item.new', [
            'categories'        => $categories,
            'item'              => new Item(),
            'listing_durations' => ListingDuration::all(),
            'item_conditions'   => ItemCondition::all(),
            'photos'            => $session_photos,
        ]);
    }
public function getNew()
    {
        $categories = Category::leaves()->orderBy('category_id')->get();

        if (!session()->has('photos')) {
            $session_photos = [];
        } else {
            foreach (session('photos') as $session_photo) {
                $session_photos[] = \Hamjoint\Mustard\Media\Photo::find($session_photo['photo_id']);
            }
        }

        return view('mustard::item.new', [
            'categories'        => $categories,
            'item'              => new Item(),
            'listing_durations' => ListingDuration::all(),
            'item_conditions'   => ItemCondition::all(),
            'photos'            => $session_photos,
        ]);
    }
public function getNew ( ) { $ categories = Category :: leaves ( ) -> orderBy ( 'category_id' ) -> get ( ) ; if ( ! session ( ) -> has ( 'photos' ) ) { $ session_photos = [ ] ; } else { foreach ( session ( 'photos' ) as $ session_photo ) { $ session_photos [ ] = \ Hamjoint \ Mustard \ Media \ Photo :: find ( $ session_photo [ 'photo_id' ] ) ; } } return view ( 'mustard::item.new' , [ 'categories' => $ categories , 'item' => new Item ( ) , 'listing_durations' => ListingDuration :: all ( ) , 'item_conditions' => ItemCondition :: all ( ) , 'photos' => $ session_photos , ] ) ; }
Return the new item view.

@param int $itemId

@return \Illuminate\View\View
Return the new item view .