Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(laravel): provide a trait in addition to the annotation #6543

Merged
merged 6 commits into from
Aug 26, 2024

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Aug 23, 2024

Q A
Branch? main
Tickets n/a
License MIT
Doc PR n/a

Provide a more idiomatic way to mark an Eloquent model as an ApiResource (annotations still work!):

namespace App\Models;

use ApiPlatform\Laravel\IsApiResource;
use Illuminate\Database\Eloquent\Model;

class Author extends Model
{
    use IsApiResource;
}

@soyuka soyuka merged commit 9c46162 into api-platform:main Aug 26, 2024
56 of 59 checks passed
@dunglas dunglas deleted the feat/laravel-trait branch August 26, 2024 21:21
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.

2 participants