aabosham/laravel-like

Create like for any models for laravel framework

dev-master 2022-05-28 16:21 UTC

This package is auto-updated.

Last update: 2024-11-12 13:22:01 UTC


README

Likeable is a package for Laravel.

Installation

From the command line, run:

composer require aabosham/laravel-like
php artisan migrate
<?php

namespace App;

use Aabosham\Likeable\Likeable;

class Post extends Model
{
    use Likeable;

    ...
}
$model->isLikedBy();


$model->liked();

$model->likedsCount();

Scoping

$models = Model::likedBy(User $user)->get();