app/Http/Controllers/CategoryController.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, Category $category)
    {
        request()->validate([
            'name' => 'required',
        ]);
        $category->save();
        return redirect('category')->with('message', 'Category Edited Successfully');
    }
public function update ( Request $ request , Category $ category ) { request ( ) -> validate ( [ 'name' => 'required' , ] ) ; $ category -> save ( ) ; return redirect ( 'category' ) -> with ( 'message' , 'Category Edited Successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .