I am using laravel 10 and building rest api. I am creating Categories resorce,controller, model
Route::apiResource('/admin-category', CategoryController::class);
this is the route in api.php.
<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Category;
use App\Http\Requests\StoreCategoryRequest;
use App\Http\Requests\UpdateCategoryRequest;
use App\Http\Resources\CategoryResource;

class CategoryController extends Controller
{
    /**
    * Display a listing of the resource.
    */
    public function index()
    {
        return Category::query()->orderBy('id', 'desc')
            ->paginate(10);
    }

    /**
     * Store a newly created resource in storage.
     */
     public function store(StoreCategoryRequest $request)
     {
        $data = $request->validated();
        $data['image'] = $request['image'];
        $data['description'] = $request['description'];
        Category::create($data);
        return response(['success' => true, 'msg' => 'New Category created!'], 201);
     }

    /**
     * Display the specified resource.
     */
    public function show(Category $category)
    {
        // 
    }

    /**
     * Update the specified resource in storage.
     */
    public function update(UpdateCategoryRequest $request, Category $category)
    {
        $data = $request->validated();
        if(isset($request['image'])){
            $data['image'] = $request['image'];
        }
        $category->update($data);
        return response(['success' => true, 'msg' => 'Category updated!'], 200);
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy(Category $category)
    {
        $category->delete();
        return response(['msg' => 'Deleted successfully', 'success' => true], 201);
    }
}

This is my controller and here index() and store method is working as well but destroy and update is not working and not showing any error.
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
   use HasFactory;

/**
 * The attributes that are mass assignable.
 *
 * @var array<int, string>
 */
  protected $fillable = [
    'name',
    'image',
    'description'
  ];
}

This is Category model.
And migration is
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('image')->nullable();
            $table->string('description')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('categories');
    }
};

I am trying from frontend. And category creating and fetch is working perfectly.
what is the problem with destroy and update?
I have checked many times payload is sending correctly with category id