1. Go to this page and download the library: Download struktal/struktal-auth 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/ */
struktal / struktal-auth example snippets
enum PermissionLevel: int implements \struktal\Auth\PermissionLevel {
// Examples:
case USER = 0;
case ADMIN = 1;
public function value(): int {
return $this->value;
}
}
class User extends \struktal\ORM\GenericUser {
#[\struktal\ORM\InheritedType(PermissionLevel::class)]
public ?PermissionLevel $permissionLevel = null;
// You can add custom methods or properties here if needed
}
class UserDAO extends \struktal\ORM\GenericUserDAO {
// You can add custom methods or properties here if needed
}