classes/Controllers/Base.php
public function edit($id)
    {
        // Get the model instance
        $item = $this->findOrFail($id);

        // Respond to AJAX requests for a single item with JSON
        if (Request::ajax()) {
            return Response::json($item);
        }

        // Look for overriden views
        $this->overrideViews();

        // Populate form
        Former::populate($item);
        Former::withRules($this->getRules());

        // Initialize localization
        with($localize = new Localize)
            ->item($item)
            ->title(Str::singular($this->title));

        // Make the sidebar
        $sidebar = new Sidebar($item);
        if (!$localize->hidden()) {
            $sidebar->addToEnd($localize);
        }

        // Render view
        return $this->populateView($this->show_view, [
            'item' => $item,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
public function edit($id)
    {
        // Get the model instance
        $item = $this->findOrFail($id);

        // Respond to AJAX requests for a single item with JSON
        if (Request::ajax()) {
            return Response::json($item);
        }

        // Look for overriden views
        $this->overrideViews();

        // Populate form
        Former::populate($item);
        Former::withRules($this->getRules());

        // Initialize localization
        with($localize = new Localize)
            ->item($item)
            ->title(Str::singular($this->title));

        // Make the sidebar
        $sidebar = new Sidebar($item);
        if (!$localize->hidden()) {
            $sidebar->addToEnd($localize);
        }

        // Render view
        return $this->populateView($this->show_view, [
            'item' => $item,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
public function edit ( $ id ) { // Get the model instance $ item = $ this -> findOrFail ( $ id ) ; // Respond to AJAX requests for a single item with JSON if ( Request :: ajax ( ) ) { return Response :: json ( $ item ) ; } // Look for overriden views $ this -> overrideViews ( ) ; // Populate form Former :: populate ( $ item ) ; Former :: withRules ( $ this -> getRules ( ) ) ; // Initialize localization with ( $ localize = new Localize ) -> item ( $ item ) -> title ( Str :: singular ( $ this -> title ) ) ; // Make the sidebar $ sidebar = new Sidebar ( $ item ) ; if ( ! $ localize -> hidden ( ) ) { $ sidebar -> addToEnd ( $ localize ) ; } // Render view return $ this -> populateView ( $ this -> show_view , [ 'item' => $ item , 'localize' => $ localize , 'sidebar' => $ sidebar , 'parent_id' => $ this -> parent ? $ this -> parent -> getKey ( ) : null , ] ) ; }
Show the edit form.  Sets view via the layout.

@param  int                               $id Model key
@return Illuminate\Contracts\View\Factory
Show the edit form . Sets view via the layout .