1. Go to this page and download the library: Download hexters/hexa-lite 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/ */
hexters / hexa-lite example snippets
use Filament\Panel;
use Hexters\HexaLite\HexaLite;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
HexaLite::make(),
]);
}
use Hexters\HexaLite\HexaLiteRolePermission;
class User extends Authenticatable
{
use HasFactory, Notifiable;
use HexaLiteRolePermission;
}
use Filament\Forms;
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('email')
->unique(ignoreRecord: true)
->
public function panel(Panel $panel): Panel
{
return $panel->authGuard('reseller');
}
public function panel(Panel $panel): Panel
{
return $panel->authGuard('customer');
}
use Hexters\HexaLite\HasHexaLite;
class UserResource extends Resource
{
use HasHexaLite;
public function defineGates(): array
{
return [
'user.index' => __('Allows viewing the user list'),
'user.create' => __('Allows creating a new user'),
'user.update' => __('Allows updating users'),
'user.delete' => __('Allows deleting users'),
];
}
}
public static function canAccess(): bool
{
return hexa()->can('user.index');
}