Download the PHP package tequilarapido/presenter without Composer
On this page you can find all versions of the php package tequilarapido/presenter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tequilarapido/presenter
More information about tequilarapido/presenter
Files in tequilarapido/presenter
Package presenter
Short Description Simple and straightforward presenter implementation for Eloquent models.
License MIT
Homepage https://github.com/tequilarapido/presenter
Informations about the package presenter
Simple and straightforward presenter implementation for Eloquent models.
Contents
- Installation
- Usage
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package using composer
Usage
Let's assume we have a User model class
- 1/ Create a presenter class like the following, and add presentation methods to it. For the example, we'll make a method that will return the user full name.
We can access model property directly inside the presenter class. We can also access them via the $model property
-
2/ you need to reference this class in the model using a public
$presenter
property and use thePrensentable
trait. - 3/ You can than get the presented value like so :
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Nassif Bourguig
- All Contributors
License
The MIT License (MIT). Please see License File for more information.