2017 © Pedro Peláez
 

library laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

image

rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  • Thursday, August 4, 2016
  • by rtconner
  • Repository
  • 13 Watchers
  • 229 Stars
  • 34,308 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 32 Forks
  • 8 Open issues
  • 16 Versions
  • 3 % Grown

The README.md

Laravel Likeable Plugin

Build Status Latest Stable Version License, (*1)

Trait for Laravel Eloquent models to allow easy implementation of a "like" or "favorite" or "remember" feature., (*2)

Composer Install

composer require rtconner/laravel-likeable

Then run the migrations

php artisan migrate

Setup your models

class Article extends \Illuminate\Database\Eloquent\Model {
    use \Conner\Likeable\Likeable;
}

Sample Usage

$article->like(); // like the article for current user
$article->like($myUserId); // pass in your own user id
$article->like(0); // just add likes to the count, and don't track by user

$article->unlike(); // remove like from the article
$article->unlike($myUserId); // pass in your own user id
$article->unlike(0); // remove likes from the count -- does not check for user

$article->likeCount; // get count of likes

$article->likes; // Iterable Illuminate\Database\Eloquent\Collection of existing likes

$article->liked(); // check if currently logged in user liked the article
$article->liked($myUserId);

Article::whereLikedBy($myUserId) // find only articles where user liked them
    ->with('likeCounter') // highly suggested to allow eager load
    ->get();

Credits

  • Robert Conner - http://smartersoftware.net

The Versions

04/08 2016

dev-laravel-5

dev-laravel-5 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait laravel5 remember like follow favorite likeable likable favourite

15/02 2016

1.2.1

1.2.1.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

07/02 2016

1.2.0

1.2.0.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

18/01 2016

1.1.0

1.1.0.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

09/11 2015

1.0.8

1.0.8.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

30/05 2015

1.0.7

1.0.7.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

28/05 2015

1.0.4

1.0.4.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

08/05 2015

1.0.3

1.0.3.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

07/05 2015

1.0.2

1.0.2.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

17/02 2015

1.0.1

1.0.1.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

15/02 2015

dev-laravel-4

dev-laravel-4 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

15/02 2015

0.2.0

0.2.0.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

15/02 2015

1.0.0

1.0.0.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

20/09 2014

0.1.2

0.1.2.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

19/09 2014

0.1.1

0.1.1.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite

19/09 2014

0.1.0

0.1.0.0 https://smartersoftware.net/packages/laravel-likeable-favorite

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel eloquent trait remember like follow favorite likeable likable favourite