aabosham / laravel-like
Create like for any models for laravel framework
dev-master
2022-05-28 16:21 UTC
Requires
- php: ^7.2|^8.0
- illuminate/support: ^6.0|^7.0|^8.0|^9
Requires (Dev)
- phpunit/phpunit: ^8.0
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();