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\Traits\HexAccess;
. . .
use HexAccess;
protected static ?string $permissionId = 'access.user';
protected static ?string $descriptionPermission = 'Admin can manage User accounts';
/**
* Additional permission (optional)
* You can add it or not depending on the needs of your application.
*/
protected static ?array $subPermissions = [
'access.user.create' => 'Can Create',
'access.user.edit' => 'Can Edit',
'access.user.delete' => 'Can Delete',
];
public static function canAccess(): bool
{
return hexa()->can(static::$permissionId);
}
. . .