Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Add trait handling#36

Open
benbjurstrom wants to merge 5 commits intotighten:mainfrom
benbjurstrom:add-trait-handling
Open

Add trait handling#36
benbjurstrom wants to merge 5 commits intotighten:mainfrom
benbjurstrom:add-trait-handling

Conversation

@benbjurstrom
Copy link
Copy Markdown

Depends on #35

This pull request allows you to add traits to classes. It uses PhpParser and works similar to the existing addImports method.

Example usage:
$this->file->addTraits('app/Models/User.php', 'HasUuids');
$this->file->addTraits('app/Models/User.php', ['HasFactory', 'Notifiable', 'HasUuids']);

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant