app/Http/Controllers/PostTagController.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)
    {
        $postTag=PostTag::findOrFail($id);
         $this->validate($request,[
            'title'=>'string|required',
            'status'=>'required|in:active,inactive'
        ]);
        $data=$request->all();
        $status=$postTag->fill($data)->save();
        if($status){
            request()->session()->flash('success','Post Tag Successfully updated');
        }
        else{
            request()->session()->flash('error','Please try again!!');
        }
        return redirect()->route('post-tag.index');
    }
public function update ( Request $ request , $ id ) { $ postTag = PostTag :: findOrFail ( $ id ) ; $ this -> validate ( $ request , [ 'title' => 'string|required' , 'status' => 'required|in:active,inactive' ] ) ; $ data = $ request -> all ( ) ; $ status = $ postTag -> fill ( $ data ) -> save ( ) ; if ( $ status ) { request ( ) -> session ( ) -> flash ( 'success' , 'Post Tag Successfully updated' ) ; } else { request ( ) -> session ( ) -> flash ( 'error' , 'Please try again!!' ) ; } return redirect ( ) -> route ( 'post-tag.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// return $request->all();