PHP code example of evanschleret / laravel-user-presence
1. Go to this page and download the library: Download evanschleret/laravel-user-presence 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/ */
evanschleret / laravel-user-presence example snippets
use EvanSchleret\LaravelUserPresence\Traits\HasUserPresence;
class User extends Authenticatable
{
use HasUserPresence;
}
namespace App\Presence;
use EvanSchleret\LaravelUserPresence\Contracts\PresencePolicy;
use Illuminate\Database\Eloquent\Model;
class UserPresencePolicy implements PresencePolicy
{
public function isEnabled(Model $user): bool
{
return (bool) $user->getAttribute('presence_enabled');
}
}