escolalms / auth
Escola Headless LMS Authorization
0.2.41
2026-05-26 08:32 UTC
Requires
- php: >=7.4 | >=8.0
- doctrine/dbal: ^2|^3
- escolalms/categories: >=0.1
- escolalms/core: >=0.1.6
- escolalms/files: ^0
- escolalms/model-fields: ^0
- laravel/framework: >=9.0
- laravel/socialite: ^5.1
Requires (Dev)
- escolalms/notifications: ^0
- escolalms/settings: ^0.1.3
- maatwebsite/excel: ^3.1
- nunomaduro/larastan: ^2.0
- orchestra/testbench: ^7.0
- phpunit/phpunit: ^9.0
Suggests
- escolalms/settings: ^0.1.3
- maatwebsite/excel: ^3.1
This package is auto-updated.
Last update: 2026-05-26 08:33:02 UTC
README
What does it do
Package for user authentication. In addition, the package includes:
- user management,
- group management,
- profile management,
- registration.
Installing
composer require escolalms/authphp artisan migratephp artisan db:seed --class="EscolaLms\Auth\Database\Seeders\AuthPermissionSeeder"
Optional:
- Run command
escolalms:admin.
Commands
escolalms:admin- create account with role admin
Database
category_user- Table is used to store the user categories.groups- Table for storing groups.group_user- Table for storing groups assigned to the user.
User 1 -> n Categories
User 1 -> n Groups
Endpoints
All the endpoints are defined in
Tests
Run ./vendor/bin/phpunit to run tests.
Events
AccountBlocked- Event is dispatched after blocking the user's account (is_active=false).AccountConfirmed- Event is dispatched after the user verifies the account.AccountDeleted- Event is dispatched after deleting the user.AccountMustBeEnableByAdmin- Event is dispatched when the user registers andConfig::get('escola_auth.account_must_be_enabled_by_admin') === SettingStatusEnum::ENABLEDAccountRegistered- Event is dispatched after the account is registered.ForgotPassword- Event is dispatched when a password reset request is sent.Login- Event is dispatched on successful login.Logout- Event is dispatched after logout.PasswordChanged- Event is dispatched after the password changed.ResetPassword- Event is dispatched after resetting the password.UserAddedToGroup- Event is dispatched after adding the user to the group.UserRemovedFromGroup- Event is dispatched after removing the user from the group.
Listeners
CreatePasswordResetToken- The listener listens for the ForgotPassword event and executes the following method.
public function handle(ForgotPassword $event): void { if (!is_callable(self::getRunEventForgotPassword()) || self::getRunEventForgotPassword()()) { $user = $event->getUser(); $this->userRepository->update([ 'password_reset_token' => Str::random(32), ], $user->getKey()); $user->refresh(); $user->notify(new ResetPassword($user->password_reset_token, $event->getReturnUrl())); } }
This is useful if you are using TemplateEmail and you don't want to send the default e-mails.
CreatePasswordResetToken::setRunEventForgotPassword( function () { $templateRepository = app(TemplateRepositoryContract::class); return empty($templateRepository->findTemplateDefault( ForgotPassword::class, EmailChannel::class )); } );
SendEmailVerificationNotification- The listener listens for the AccountRegistered event and executes the following method.
public function handle(Registered $event) { if (!is_callable(self::getRunEventEmailVerification()) || self::getRunEventEmailVerification()()) { if ($event->user instanceof MustVerifyEmail && !$event->user->hasVerifiedEmail()) { $event->user->sendEmailVerificationNotification(); } } }
How to use this on frontend
Admin panel
Permissions
Permissions are defined in seeder.





