app/Http/Controllers/CategoryController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Category  $category
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(UpdateCategoryRequest $request, Category $category)
    {
        if ($request->validated()){
            $category->update($request->validated());
            return redirect()->route('category.index')->with('message','Category is Updated');
        }else{
            return redirect()->route('category.index')->withErrors($request->validated());
        }
    }
public function update ( UpdateCategoryRequest $ request , Category $ category ) { if ( $ request -> validated ( ) ) { $ category -> update ( $ request -> validated ( ) ) ; return redirect ( ) -> route ( 'category.index' ) -> with ( 'message' , 'Category is Updated' ) ; } else { return redirect ( ) -> route ( 'category.index' ) -> withErrors ( $ request -> validated ( ) ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .
//