Download the PHP package loafer/laravel-likeable without Composer

On this page you can find all versions of the php package loafer/laravel-likeable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-likeable

Laravel Likeable

cog-laravel-likeable

Build Status StyleCI Releases License

Attention

This package is abandoned and no longer maintained. Development moved to Laravel Love package!

If you already have installed version of Laravel Likeable you can use Laravel Love Migration Guide.

Introduction

Laravel Likeable simplify management of Eloquent model's likes & dislikes. Make any model likeable & dislikeable in a minutes!

Contents

Features

Installation

First, pull in the package through Composer.

If you are using Laravel 5.5 you can skip register package part.

Register package on Laravel 5.4 and lower

Include the service provider within app/config/app.php.

Perform Database Migration

At last you need to publish and run database migrations.

Usage

Prepare likeable model

Use Likeable contract in model which will get likes behavior and implement it or just use Likeable trait.

Available methods

Likes

Like model
Remove like mark from model
Toggle like mark of model
Get model likes count
Get model likes counter
Get likes relation
Get iterable Illuminate\Database\Eloquent\Collection of existing model likes
Boolean check if user liked model

Checks in eager loaded relations likes & likesAndDislikes first.

Get collection of users who liked model
Delete all likes for model

Dislikes

Dislike model
Remove dislike mark from model
Toggle dislike mark of model
Get model dislikes count
Get model dislikes counter
Get dislikes relation
Get iterable Illuminate\Database\Eloquent\Collection of existing model dislikes
Boolean check if user disliked model

Checks in eager loaded relations dislikes & likesAndDislikes first.

Get collection of users who disliked model
Delete all dislikes for model

Likes and Dislikes

Get difference between likes and dislikes
Get likes and dislikes relation
Get iterable Illuminate\Database\Eloquent\Collection of existing model likes and dislikes

Scopes

Find all articles liked by user
Find all articles disliked by user
Fetch Likeable models by likes count

Uses desc as default order direction.

Fetch Likeable models by dislikes count

Uses desc as default order direction.

Events

On each like added \Cog\Likeable\Events\ModelWasLiked event is fired.

On each like removed \Cog\Likeable\Events\ModelWasUnliked event is fired.

On each dislike added \Cog\Likeable\Events\ModelWasDisliked event is fired.

On each dislike removed \Cog\Likeable\Events\ModelWasUndisliked event is fired.

Console commands

Recount likes and dislikes of all model types
Recount likes and dislikes of concrete model type (using morph map alias)
Recount likes and dislikes of concrete model type (using fully qualified class name)
Recount only likes of all model types
Recount only likes of concrete model type (using morph map alias)
Recount only likes of concrete model type (using fully qualified class name)
Recount only dislikes of all model types
Recount only dislikes of concrete model type (using morph map alias)
Recount only dislikes of concrete model type (using fully qualified class name)

Extending

You can override core classes of package with your own implementations:

Note: Don't forget that all custom models must implement original models interfaces.

To make it you should use container binding interfaces to implementations in your application service providers.

Use model class own implementation
Use service class own implementation

After that your CustomLike and CustomService classes will be instantiable with helper method app().

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Testing

You can run the tests with:

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributors

@antonkomarev
Anton Komarev
@acidjazz
Kevin Olson

Laravel Likeable contributors list

Alternatives

Feel free to add more alternatives as Pull Request.

License

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research best solutions in product & software development is our passion.

CyberCog


All versions of laravel-likeable with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|^7.0
illuminate/database Version ~5.1.20|~5.2|~5.3|~5.4|~5.5
illuminate/support Version ~5.1.20|~5.2|~5.3|~5.4|~5.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package loafer/laravel-likeable contains the following files

Loading the files please wait ....