Skip to content

Add RouteKeyMethodToRouteKeyAttributeRector - #537

Open
MrPunyapal wants to merge 1 commit into
driftingly:mainfrom
MrPunyapal:feat/routekey-attribute-rule
Open

Add RouteKeyMethodToRouteKeyAttributeRector #537
MrPunyapal wants to merge 1 commit into
driftingly:mainfrom
MrPunyapal:feat/routekey-attribute-rule

Conversation

@MrPunyapal

Copy link
Copy Markdown
Contributor

This PR adds a rule to apply the new RouteKey rule.

Example.

 use Illuminate\Database\Eloquent\Model;

+#[\Illuminate\Database\Eloquent\Attributes\RouteKey('slug')]
 class Post extends Model
 {
-    public function getRouteKeyName(): string
-    {
-        return 'slug';
-    }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant