PHP code example of phpdominicana / reactify

1. Go to this page and download the library: Download phpdominicana/reactify 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/ */

    

phpdominicana / reactify example snippets


return [
];

class comments extends Model
{
    use Reactify;
}

$comment = Comment::find(1);
$comment->react($user->id, Reaction::LIKE);
$comment->react($user->id, Reaction::DISLIKE);
$comment->react($user->id, Reaction::LOVE);
$comment->react($user->id, Reaction::HAHA);
$comment->getReactCountByType(Reaction::LIKE);
bash
php artisan vendor:publish --tag="reactify-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="reactify-config"
bash
php artisan vendor:publish --tag="reactify-views"