docs(laravel): match code generators to lettr-laravel 2.7.0 - #72
Merged
Merged
Conversation
Type Safety and Templates described generated code the package never produced (snake_case DTO properties, a toArray() that drops nulls, a build()-based Mailable) and a mergeTags property TemplateDetail doesn't have. Samples are now real generator output, and the pages cover the behaviour lettr-laravel#20 adds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Laravel Type Safety and Templates pages described generated code that the package never produced: DTOs with snake_case properties and a
toArray()that drops nulls, a Mailable built inbuild(). The Templates page also documented a$template->mergeTagsproperty thatTemplateDetaildoesn't have. lettr-com/lettr-laravel#20 also changes what the generators output and how they behave.Every code sample is now real output from the generators on that branch. The docblocks were printed by the generator itself, so they match word for word.
Changes
quickstart/laravel/type-safety.mdxwelcome-email→WelcomeEmail,2fa-code→Template2faCode,class→ClassTemplate.final readonly class … implements Arrayableshape, with camelCase properties--template/--dry-run, and an unknown--templateexiting with a failure code--as-html/--skip-templates), and where each one's subject comes fromhtml_pathandblade_path, relative paths, fallback to defaults for keys left out, and the PSR-4 autoload warning.sendTemplate()now takes the DTO directly, since it implementsArrayable.quickstart/laravel/templates.mdxlettr:pulloptions: adds--skip-templatesand--dry-run, plus how merge tags and loops convert to Blade (@foreach($items ?? [] as $item)with$item['name']).lettr:push: without--pathit looks inblade_pathfirst; a relative--pathresolves against the project root.$template->mergeTagswithLettr::templates()->getMergeTags().Verified against the release
Every sample was re-checked against files generated by the released 2.7.0 in a plain Laravel app (
example-new-laravel, 138 templates): the enum, DTO and both Mailable kinds match the generated output, docblock wording included. That run produced 138 enum cases, 37 DTOs and 117 Mailables with 117 views, all of which load, render and pass Pint.Test Plan
mintlify broken-linkspasses. It passed locally./quickstart/laravel/type-safetyin the Mintlify preview. Check that the two tables and the code samples render, and that the#mailable-classesanchor still works:sending-emails.mdxlinks to it./quickstart/laravel/templatesand check the pull/push option lists and the merge tag example.php artisan lettr:generate-dtos --template=<slug>in a Laravel app and compare with the Template DTOs sample.🤖 Generated with Claude Code