route('workOrder'); // if work_order is model if ($work_order instanceof WorkOrder) { $work_order_id = $work_order->id; } else { $work_order_id = $work_order; } return WorkOrder::where('user_id', auth('api')->id())->where('id', $work_order_id)->exists(); return false; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ // ]; } }