1. Go to this page and download the library: Download awcodes/trov 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/ */
awcodes / trov example snippets
use Spatie\Permission\Traits\HasRoles;
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements FilamentUser
{
use HasRoles;
public function canAccessFilament(): bool
{
// this can be anything as long as it returns true / false
return str_ends_with($this->email, '@domain.com') && $this->getRoleNames()->isNotEmpty();
}
}