app/Http/Controllers/AdminCategoryController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\AdminCategory  $adminCategory
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Category $category)
    {   
        $rules = [
            'name' => 'required',
            'slug' => 'required',
            'description' => 'required'
        ];
        $validatedData = $request->validate($rules);
        Category::where('id', $category->id)
            ->update($validatedData);
        return redirect('dashboard/categories')->with('success', 'Edit Success');
    }
public function update ( Request $ request , Category $ category ) { $ rules = [ 'name' => 'required' , 'slug' => 'required' , 'description' => 'required' ] ; $ validatedData = $ request -> validate ( $ rules ) ; Category :: where ( 'id' , $ category -> id ) -> update ( $ validatedData ) ; return redirect ( 'dashboard/categories' ) -> with ( 'success' , 'Edit Success' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .