1. Go to this page and download the library: Download timgavin/laravel-block 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/ */
timgavin / laravel-block example snippets
namespace App\Models;
use TimGavin\LaravelBlock\LaravelBlock;
class User extends Authenticatable
{
use LaravelBlock;
}
auth()->user()->block($user);
auth()->user()->unblock($user);
@if (auth()->user()->isBlocking($user))
You are blocking this user.
@endif
@if (auth()->user()->isBlockedBy($user))
This user is blocking you.
@endif