PHP code example of aabosham / laravel-favorite

1. Go to this page and download the library: Download aabosham/laravel-favorite library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aabosham / laravel-favorite example snippets




namespace App;

use Aabosham\Favoritable\Favoritable;

class Post extends Model
{
    use favoritable;

    ...
}

$model->isFavoritedBy();


$model->favorite();

$model->favoritesCount();

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

php artisan migrate