PHP code example of stevecreekmore / laravel-like

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

    

stevecreekmore / laravel-like example snippets


namespace App\Models;

use stevecreekmore\LaravelLike\LaravelLike;

class User extends Authenticatable
{
    use LaravelLike;
}

auth()->user()->like($user);

auth()->user()->unlike($user);

@if (auth()->user()->isLiking($user))
    You are liking this user.
@endif

@if (auth()->user()->isLikedBy($user))
    This user is liking you.
@endif

auth()->user()->getLiking();

auth()->user()->getLikers();

auth()->user()->getLikingIds();

auth()->user()->getLikersIds();

auth()->user()->getLikingAndLikersIds()

php artisan migrate