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)
    {
        $this->validateWith([
            'page_title' => 'required',
            'content' => 'required'
        ]);
        $page = Blog::FindOrFail($id);
        $page->page_title = $request->page_title;
        $page->slug = str_slug($request->page_title);
        $page->subtitle = $request->subtitle;
        $page->content = $request->content;
        $page->save();
        Session::flash('success', 'Succesfully Updated Page');
        return redirect()->back();
    }
public function update ( Request $ request , $ id ) { $ this -> validateWith ( [ 'page_title' => 'required' , 'content' => 'required' ] ) ; $ page = Blog :: FindOrFail ( $ id ) ; $ page -> page_title = $ request -> page_title ; $ page -> slug = str_slug ( $ request -> page_title ) ; $ page -> subtitle = $ request -> subtitle ; $ page -> content = $ request -> content ; $ page -> save ( ) ; Session :: flash ( 'success' , 'Succesfully Updated Page' ) ; return redirect ( ) -> back ( ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// 'image' => 'required',