dewsign / laravel-authors
Ability to attach users as authors to any content
Installs: 321
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 2
Type:package
Requires
- php: >=7.0.0
- laravel/framework: >=5.0.0
Requires (Dev)
- squizlabs/php_codesniffer: >=3.1
This package is auto-updated.
Last update: 2024-11-30 01:47:09 UTC
README
Installation
composer require dewsign/laravel-authors
Usage
Attach the trait to any model which you want to be Author-able. E.g. Article
.
// App\Article.php ... use Dewsign\LaravelAuthors\Traits\HasAuthors; ...
If you are not using the default User
model for your Authors, you can specify the model you are using in the laravel-authors.php
config.
You can now use the Many to Many authors
relationship on your Article
model to manage authors on this model.
Known issues
An additional trait to define the inverse relationship on your Author (User) model, IsAuthor
is included, however for some reason this isn't working. You can define your own inverse to specific models in the meantime.