I copied string()->email() from the docs and StringType does not have it

I copied string()->email() from the docs and StringType does not have it

Laravel 13.43 adds JsonSchema::rules() and #[RetryFor]. The validation docs still call string()->email(), and StringType has format() instead. Packagist this morning is 13.44.1. ValidationRules.php matches 13.43.0.

· Updated · 9 min read #laravel #php #validation #json-schema #queues

 13.42 has the builder. rules() and RetryFor start in 13.43. 13.44.1 is current

Caption: ValidationRules.php, JsonSchema.php, RetryFor.php, and InteractsWithQueue.php are the same bytes on v13.43.0, v13.44.0, and v13.44.1. MatchesEnum.php and DistinctArrayItems.php are not.

Introduction

The 18 Nov post left these two APIs alone. I am writing this on 25 Nov 2026 (2026-W48). The queue row is 2026-W47, priority 8, the lowest undone item. Nothing is tagged 2026-W48. Laravel News covered JsonSchema::rules() and #[RetryFor] on 18 Nov 2026 as 13.43, then published a rules tutorial on 24 Nov 2026. Packagist this morning is v13.44.1. I read tags v13.42.0 through v13.44.1. I did not boot.

About the feature

JsonSchema::rules() lives on Illuminate\JsonSchema\JsonSchema and calls ValidationRules::for(). A top-level name in the schema required list becomes required. An optional property that does not allow null becomes sometimes plus RejectEmptyString. nullable() adds null to the type and keeps RejectEmptyString beside nullable. A nested required key is sometimes plus filled, and the parent object carries required_array_keys.

RejectEmptyString sets $implicit = true. Its own comment says Laravel skips non-implicit rules for an empty string, so only an implicit rule can refuse one. validate() fails when $value === '' and calls $fail('validation.filled'). The English line on this tag is The :attribute field must have a value.

format('email') becomes the email rule. Scalar enum values become Rule::in. The derived integer rule is integer, not integer:strict, so filter_var accepts "3".

#[RetryFor] stores $seconds + ($minutes * 60) + ($hours * 3600). Queue::getJobExpiration() reads it only when the job has no retryUntil method and the property is not set. availableAt() adds those seconds to now. A method or a set property skips the attribute, and a set property wins over the method via ??.

releaseUsingBackoff() calls release() with no delay when backoff() is missing or null. Otherwise it explodes the comma list and uses attempts() - 1, or the last value past the end.

 Optional integer: sometimes and RejectEmptyString. Empty string fails filled

Caption: A missing key passes sometimes. null is not '', so it still has to pass integer unless the schema is nullable(). The docs FormRequest calls email(), and StringType does not have that method.

Why I picked it

The subscription tool already describes email, plan, and seats in schema(). handle() had the same limits copied into $request->validate(). The two copies drift. JsonSchema::rules() is the one list. The 18 Nov post hashed InteractsWithData.php on v13.43.0 and did not open ValidationRules.php. This lab is that file.

The failure I care about is the validation docs. The FormRequest sample, retrieved 25 Nov 2026, calls $s->string()->email(). The builder method on this tag is format('email').

Where it can be used

I would call JsonSchema::rules() from a form request, Validator::make(), or an MCP tool handle() that already returns schema(). The array is a normal rules list, so I can append another Rule:: on the same key. A bare JsonSchema::string() has no properties, so rules() returns [] and the validator accepts the payload.

#[RetryFor] is for jobs, queued mailables, queued notifications, and queued listeners. The framework test covers all four. A poller that releases itself needs a Backoff attribute before releaseUsingBackoff(). The 11 Nov slow-job hook watches duration. This attribute sets the deadline.

Benefit

Both APIs ship inside laravel/framework. v13.44.1 composer.json require matches v13.43.0, including php: ^8.3. conflict is still laravel/horizon below 5.47.0, plus the old tightenco/collect line. The only composer difference I found is require-dev: jasonmccreary/double moved from ^1.1 to ^1.2.1. That is not an app dependency.

replace sets illuminate/json-schema, illuminate/validation, and illuminate/queue to self.version. The split package's own composer.json only suggests illuminate/validation for JsonSchema::rules(). I do not composer require illuminate/json-schema.

ValidationRules.php, JsonSchema.php, RetryFor.php, and InteractsWithQueue.php match on v13.43.0, v13.44.0, and v13.44.1. On v13.42.0 the first and third are 404, and __callStatic() sends rules to a factory that has no such method. Past MAX_NODES (20000) the 13.43 method throws InvalidArgumentException. A subscription object does not.

I would bump to 13.44.1. composer update lands there. Packagist still lists 13.43.0 from 17 Nov. The November Laravel News archive has no 13.44 note through 25 Nov. The Releases API for v13.44.0 returns 404. The tag exists.

 laravel/framework 13.44.1 replaces illuminate/json-schema, validation, and queue

Caption: php is ^8.3. Horizon older than 5.47.0 will not solve. The double require-dev bump is not something I install in the app.

Practical example from a recent application

Lab shape from the queue notes, the 24 Nov tutorial, and tag v13.44.1. If composer show laravel/framework still says 13.42.x, stop. rules() is not on that tag.

composer show laravel/framework | sed -n '1,8p'
# name     : laravel/framework
# versions : * v13.44.1

Failure I hit if I paste the FormRequest from the validation docs. The sample calls email(). On v13.44.1, StringType has format(), not email(), and no __call. I did not execute the call. An undefined method on that class is:

Error: Call to undefined method Illuminate\JsonSchema\Types\StringType::email()

The same docs page already shows a raw schema with 'format' => 'email'. The 24 Nov tutorial uses ->format('email'). That is the fix. formatRules() turns email into the email rule.

The seats field is the other half. It is optional and not nullable(), so the rules are sometimes, RejectEmptyString, integer, min:1, and max:500. A missing key passes. '' fails validation.filled. null fails integer. The string "3" passes, because the rule is not integer:strict.

The tutorial prints this array for Laravel >= 13.43.0. The converter file is the same bytes on 13.44.1, and the branches above are what that file returns:

use Illuminate\JsonSchema\JsonSchema;
use Illuminate\JsonSchema\Rules\RejectEmptyString;
use Illuminate\Validation\Rule;

$schema = JsonSchema::object(fn ($schema) => [
    'email' => $schema->string()->format('email')->required(),
    'plan' => $schema->string()->enum(['monthly', 'yearly'])->required(),
    'seats' => $schema->integer()->min(1)->max(500),
]);

JsonSchema::rules($schema);

// 'email' => ['required', 'string', 'email']
// 'plan'  => ['required', 'string', Rule::in(['monthly', 'yearly'])]
// 'seats' => ['sometimes', new RejectEmptyString, 'integer', 'min:1', 'max:500']

Failure I hit if the import job still has retryUntil(). I wanted four hours from #[RetryFor(hours: 4)]. The test testRetryUntilMethodTakesPrecedenceOverTheAttribute puts #[RetryFor(90)] on a class whose retryUntil() returns now plus 5 seconds, and asserts that timestamp. A property set to 1234567890 wins the same way. Delete both. #[RetryFor] with no arguments stores 0, so availableAt(0) is already now. I did not run queue:work.

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Attributes\RetryFor;

#[RetryFor(hours: 4)]
class ImportProducts implements ShouldQueue
{
    use Queueable;
}

Failure I hit if the poller has no backoff. releaseUsingBackoff() then calls release() with no delay, and the job is immediately available. The queues docs put #[Backoff([10, 30, 60])] on the class. #[Backoff(5, 15, 60)] stores the three integers instead. getJobBackoff() implodes either list. Past the end, the last delay repeats.

use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Queue\Attributes\Backoff;

#[Backoff([10, 30, 60])]
class WaitForExport implements ShouldQueue
{
    use Queueable;

    public function handle(): void
    {
        if (! $this->export->isReady()) {
            $this->releaseUsingBackoff();

            return;
        }
    }
}

Failure I hit on the 13.44 bump if this form request already defines model(). That method landed in 13.44.0 and is not part of rules(). FormRequest uses InteractsWithModels, whose signature is model($key, $modelClass = null, ?Closure $callback = null). Issue #62632 reports the fatal as soon as the class loads:

PHP Fatal error: Declaration of StorePostRequest::model() must be compatible with Illuminate\Foundation\Http\FormRequest::model($key, $modelClass = null, ?Closure $callback = null)

The issue was closed because Laravel Nova was patched, not because 13.44.1 removed the method. I did not load a subclass. Rename the app helper. This is not a CVE.

Same tags, not this lab. PR #62558 changed MatchesEnum and DistinctArrayItems after 13.43.0 so array values compare with ===. ValidationRules.php did not change. IntegerType still has no exclusiveMinimum method. Raw schemas map that keyword to gt.

 retryUntil() or a set property skips #[RetryFor]. No backoff releases immediately

Caption: The framework test keeps the 5 second retryUntil() and ignores #[RetryFor(90)]. releaseUsingBackoff() with a null backoff calls release() with no delay.

Conclusion

What I would keep: laravel/framework at 13.44.1, format('email') instead of the docs' email(), and optional seats so '' fails validation.filled. The import job keeps #[RetryFor(hours: 4)] with no retryUntil(). The poller keeps #[Backoff([10, 30, 60])] before releaseUsingBackoff(). Horizon on that app is 5.47.0 or newer. Next I would rename any form request model() that predates 13.44.

Did you hit the same wall?

I got stuck on Error: Call to undefined method Illuminate\JsonSchema\Types\StringType::email() after copying the validation docs, and on validation.filled for an empty seats string that I thought sometimes would ignore. Did you hit the same thing — a retryUntil() method that silently beat #[RetryFor(hours: 4)], a poller that released with no delay, or a form request model() that fatals on 13.44.1? Tell me in the comments. I read them.

Need this done on your server?

I deploy and harden Laravel/CodeCanyon apps on cPanel or VPS, and offer monthly Server Watch retainers. Hire for deploy · Care plan

References

  • Laravel 13.x validation, retrieved 25 Nov 2026. "Deriving Rules From JSON Schemas" shows JsonSchema::rules(), a raw schema with format: email, and a FormRequest sample that calls string()->email(): https://laravel.com/docs/13.x/validation
  • Laravel 13.x queues, retrieved 25 Nov 2026. Time based attempts documents #[RetryFor] (seconds positional, minutes and hours named) and says a retryUntil method or property takes precedence. Releasing a job documents releaseUsingBackoff() and #[Backoff([10, 30, 60])]: https://laravel.com/docs/13.x/queues
  • Laravel News, 18 Nov 2026, "JSON Schema Validation Rules and a RetryFor Attribute in Laravel 13.43": https://laravel-news.com/laravel-13-43-0
  • Laravel News, 24 Nov 2026, "Generate Laravel Validation Rules From a JSON Schema" (Paul Redmond). The printed rules array uses format('email') and RejectEmptyString, and says Laravel >= 13.43.0: https://laravel-news.com/laravel-json-schema-validation-rules
  • PRs #62355, #62496, #62434, #62435, #62558. Form request model() issue #62632, opened 24 Nov 2026, closed 25 Nov 2026 via Laravel Nova. The framework method is still on v13.44.1.
  • Tags v13.42.0 through v13.44.1. On 13.43 through 13.44.1, ValidationRules.php SHA-256 is 73be7dc585f0fbe0d81a4e38d7633bba555ea3cf29a9e7cb4bde60f4b3e402bf and RetryFor.php is 841c899b763f69e70644fe4f3bae6ddd2022ea61726d6e13add52977f75cc465. Both files are absent on 13.42. Packagist v13.43.0 time 17 Nov 2026 14:58 UTC, GitHub release 15:00 UTC, sha 72aa7e15. v13.44.0 time 24 Nov 2026 15:48 UTC, commit 9d3d8e77. The Releases API for v13.44.0 returns 404. v13.44.1 time 16:10 UTC, GitHub release 16:11 UTC, sha 8a8c4a84: https://packagist.org/packages/laravel/framework
  • v13.44.1 composer.json require matches v13.43.0, including php: ^8.3. replace sets illuminate/json-schema, illuminate/validation, and illuminate/queue to self.version. Conflict: laravel/horizon below 5.47.0. No CVE number is claimed here.
Share:

Get new posts in your inbox

No spam. One short email per new article — practical PHP, Laravel, devops, and AI-assisted workflows.

Comments

Powered by GitHub Discussions via Giscus. A free GitHub account is required.