app/Http/Controllers/PageController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $page = Page::find($id);
        $this->validate($request,[
            'title' => 'required|max:255',
            'user_id' => 'required',
            'content' => 'required'
        ]);
        $page ->title = $request->title;
        $page ->content = $request->content;
        $page ->user_id = $request->user_id;
        $page ->keyword = $request->keyword;
        $page ->short_desc = $request->short_desc;
        $page->save();
        return redirect()->route('page.index');
    }
public function update ( Request $ request , $ id ) { $ page = Page :: find ( $ id ) ; $ this -> validate ( $ request , [ 'title' => 'required|max:255' , 'user_id' => 'required' , 'content' => 'required' ] ) ; $ page -> title = $ request -> title ; $ page -> content = $ request -> content ; $ page -> user_id = $ request -> user_id ; $ page -> keyword = $ request -> keyword ; $ page -> short_desc = $ request -> short_desc ; $ page -> save ( ) ; return redirect ( ) -> route ( 'page.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// Session::flask('success','Page updated succesfully.');