User like features for laravel application.
sebastian-kennedy/laravel-like is a Laravel package for user like features for laravel application..
It currently has 2 GitHub stars and 1 downloads on Packagist (latest version v1.0.0).
Install it with composer require sebastian-kennedy/laravel-like.
Discover more Laravel packages by sebastian-kennedy
or browse all Laravel packages to compare alternatives.
Last updated
User like feature for laravel application.
$ composer require sebastian-kennedy/laravel-like -vvv
$ php artisan vendor:publish --provider="SebastianKennedy\\LaravelLike\\LikeServiceProvider" --tag=config
$ php artisan vendor:publish --provider="SebastianKennedy\\LaravelLike\\LikeServiceProvider" --tag=migrations
<?php
namespace SebastianKennedy\LaravelLike\Tests\Models;
use Illuminate\Database\Eloquent\Model;
use SebastianKennedy\LaravelLike\Behaviors\CanBeLikedBehavior;
class Book extends Model
{
use CanBeLikedBehavior;
protected $fillable = ['title'];
}
<?php
namespace SebastianKennedy\LaravelLike\Tests\Models;
use Illuminate\Database\Eloquent\Model;
use SebastianKennedy\LaravelLike\Behaviors\CanLikeBehavior;
class User extends Model
{
use CanLikeBehavior;
protected $fillable = ['name'];
}
<?php
$user = User::first();
$book = Book::first();
$user-like($book);
$user->unlike($book);
$user->toggleLike($book);
$user->hasLiked($book);
$user->likes();
$book->isLikedBy($user);
$book->likes();
$book->likers();
You can contribute in one of three ways:
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-12 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
MIT