Download the PHP package lemaur/eloquent-publishing without Composer
On this page you can find all versions of the php package lemaur/eloquent-publishing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package eloquent-publishing
Easily make your eloquent model publishable
This package provides a trait that will help you publishing eloquent models.
It also includes custom schema builder blueprint methods to help you setting up your migrations with ease.
Support Me
Hey folks,
Do you like this package? Do you find it useful and it fits well in your project?
I am glad to help you, and I would be so grateful if you considered supporting my work.
You can even choose 😃:
- You can sponsor me 😎 with a monthly subscription.
- You can buy me a coffee ☕ or a pizza 🍕 just for this package.
- You can plant trees 🌴. By using this link we will both receive 30 trees for free and the planet (and me) will thank you.
- You can "Star ⭐" this repository (it's free 😉).
Installation
You can install the package via composer:
Usage
Your eloquent models should use the Lemaur\Publishing\Database\Eloquent\Publishes
trait.
Your migration files should have a field to save the publishing date.
Here's a real-life example of how to implement the trait on a Post model.
(jump to all the available methods)
Available methods
Using in your migration files.
For more information about timestamps, refer to the Laravel Documentation
(jump to the customize section)
Using in your controllers, actions or whatever you need
Customize
If you want to change the column name, you need to specify it in your model and in your migration file. Let me show you:
Events
When you publish or unpublish a model, the package dispatches several events: publishing
, published
, unpublishing
, unpublished
.
The publishing
/ published
events will dispatch when a model is published.
The unpublishing
/ unpublished
events will dispatch when a model is unpublished.
For more information about the events, refer to the Laravel Documentation
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerability
Please review our security policy on how to report security vulnerabilities.
Credits
- Maurizio
- All Contributors
License
The MIT License (MIT). Please see License File for more information.