'object', 'properties' => [ 'slug' => [ 'type' => 'string', 'description' => 'Plan slug identifier', ], 'status' => [ 'type' => 'string', 'description' => 'New status', 'enum' => ['draft', 'active', 'paused', 'completed'], ], ], 'required' => ['slug', 'status'], ]; } public function handle(array $args, array $context = []): array { try { $slug = $this->require($args, 'slug'); $status = $this->require($args, 'status'); } catch (\InvalidArgumentException $e) { return $this->error($e->getMessage()); } $plan = AgentPlan::where('slug', $slug)->first(); if (! $plan) { return $this->error("Plan not found: {$slug}"); } $plan->update(['status' => $status]); return $this->success([ 'plan' => [ 'slug' => $plan->slug, 'status' => $plan->fresh()->status, ], ]); } }