chore(skill): sync magic-framework with [Unreleased] features#80
Merged
Conversation
Update the magic-framework skill to cover the seven features merged on top of 1.0.0-alpha.13: class-based casts (CastsAttributes, EnumCast, ListCast) + json Map/List, Model.fill strict flag + MassAssignmentException, FormRequest, MagicController.authorize + Gate.allowsAny/allowsAll, MagicRoute.resource + ResourceController, AsyncRule + Unique, and the Session facade with flash data + old()/error() helpers + MagicFormData auto-flash on validation failure.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Updates the Magic Framework skill and reference docs to reflect recently merged (post–1.0.0-alpha.13) framework features, including new Eloquent casting/mass-assignment behavior, validation additions (FormRequest + async rules), routing resource helpers, Gate convenience methods, and the new Session flash facade.
Changes:
- Add/expand documentation for Session flash storage (
Session,old()/error()helpers) and how it’s intended to be used with forms. - Document routing resource registration (
MagicRoute.resource) andResourceController. - Document validation + ORM additions:
FormRequest,AsyncRule/Validator.validateAsync(),Unique, and class-based casts (CastsAttributes,EnumCast,ListCast) +fill(strict:).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/magic-framework/references/secondary-systems.md | Adds Session flash-store documentation and usage/testing examples. |
| skills/magic-framework/references/routing-navigation.md | Adds resource routing (MagicRoute.resource) and ResourceController docs. |
| skills/magic-framework/references/forms-validation.md | Updates MagicFormData.validate() description; adds validateAsync(), FormRequest, and async rules/Unique docs. |
| skills/magic-framework/references/facades-api.md | Adds Session facade API; adds Gate allowsAny/allowsAll; documents MagicRoute.resource. |
| skills/magic-framework/references/eloquent-orm.md | Documents class-based casts, json Map/List casting, and fill(strict:) + MassAssignmentException. |
| skills/magic-framework/references/auth-system.md | Documents Gate allowsAny/allowsAll and MagicController.authorize(). |
| skills/magic-framework/SKILL.md | Updates skill trigger text, facade count, canonical patterns/anti-patterns, and reference index. |
Fix six factual inaccuracies flagged by Copilot: - Session.tick() is not wired automatically by the router; docs now show the explicit routerDelegate listener gated on currentLocation changes. - MagicFormData.validate() only flashes form.data, not per-field errors; update every mention. - Resource route slug preserves the normalized path (admin/users.index), no dash substitution. - MagicController.authorize throws 'This action is unauthorized: $ability'. - Add missing await on controller.destroy() example. - Bump reference index entry from 17 to 18 facades.
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
skills/magic-framework/SKILL.mdand six references to cover the seven features merged on top of1.0.0-alpha.13:CastsAttributescontract,EnumCast,ListCast, json Map/List round-trip,Model.fill(strict: true),MassAssignmentException(feat(eloquent): CastsAttributes interface for class-based custom casts #73, feat(eloquent): strict mode for Model.fill #74)FormRequest(authorize → prepared → validate),AuthorizationException,AsyncRulecontract +Unique(endpoint, field:)with debounce/stale-discard/error-tolerant behavior,Validator.validateAsync()(feat(validation): FormRequest abstraction #75, feat(validation): add async rules with Unique (#68) #78)MagicController.authorize(ability),Gate.allowsAny/Gate.allowsAllshort-circuiting helpers (feat(http): add MagicController.authorize() helper (#72) #76)MagicRoute.resource(name, controller, {only, except})+ResourceControllermixin with auto-assigned{slug}.{method}names (feat(routing): add MagicRoute.resource() (#67) #77)Sessionfacade with flash data, two-bucket store,old()/error()top-level helpers,MagicFormData.validate()auto-flash on failure (feat(session): add Session facade with flash data + auto-flash on form validation failure #79)Test plan
SKILL.md— new canonical patterns section (FormRequest, Resource Routing, Async Validation, Session Flash) renders cleanlyEnumCast,ListCast,FormRequest,ResourceController,Gate.allowsAny,Session.old, etc.)fluttersdk/airepo (skills/magic-framework/path) after merge