Download the PHP package manzadey/laravel-like without Composer
On this page you can find all versions of the php package manzadey/laravel-like. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-like
Laravel Like package
This package implements the likes/dislikes system in the laravel framework.
Index
- Installation
- Models
- Usage
Installation
You can install the package via composer:
1) Install the package via Composer
2) Publish the database from the command line:
3) Migrate the database from the command line:
Publishing the config file
Publishing the config file is optional:
Models
Your User model should import the Likeability
trait, LikeabilityContract
implements interface and use it, that trait allows the user to like the models.
(see an example below):
Your models should import the Likeable
trait, LikeableContract
implements interface and use it, that trait has the methods that you'll use to allow the model be likeable.
In all the examples I will use the Post model as the model that is 'Likeable', that's for example proposes only.
(see an example below):
That's it ... your model is now "likeable"! Now the User can favorite models that have the favoriteable trait.
Usage
A standard set of methods for working with the package:
You can also use these methods as a `Likeability' model.
Checking the model for the presence of likes/dislikes of a particular user
You can also use these methods as a `Likeability' model.
Check the current model, whether it is marked with a like/dislike
Returns a collection of users who have liked/disliked this model
We get a collection of models marked with a like/dislike
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Andrey Manzadey
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
All versions of laravel-like with dependencies
illuminate/database Version ^8.0|^9.0
php Version ^8.0|^8.1