escolalms/assign-without-account
Escola Headless LMS Assign without account
Maintainers
Package info
github.com/EscolaLMS/Assign-Without-Account
Type:package
pkg:composer/escolalms/assign-without-account
Requires
- php: >=7.4
- escolalms/cart: ^0
- escolalms/core: ^1.2.2
- laravel/framework: >=8
Requires (Dev)
- escolalms/auth: ^0
- escolalms/templates: ^0
- orchestra/testbench: ^6
- phpunit/phpunit: ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT ad8d6ae4c35b4ad8c8b6da3e9d62be248b41e0d6
- Tomasz Smolarek <tomasz.smolarek.woop@escolasoft.com>
README
👁 swagger
👁 codecov
👁 Tests PHPUnit in environments
👁 downloads
👁 downloads
👁 downloads
What does it do
The package is used to assign users without an account.
Installing
composer require escolalms/assing-without-accountphp artisan migratephp artisan db:seed --class="EscolaLms\AssignWithoutAccount\Database\Seeders\AssignWitoutAccountPermissionSeeder"
Requirements
You need to define email templates in the Templates package for AssignToProduct and AssignToProductable events.
Database
user-submissions
| id | status | created_at | updated_at | morphable_type | morphable_id | |
|---|---|---|---|---|---|---|
| 1 | test@email.com | sent | 2022-04-15 07:36:12 | 2022-04-15 07:36:12 | App\Models\Course | 1 |
| 2 | test@email.com | accepted | 2022-04-15 07:36:30 | 2022-04-15 07:36:30 | EscolaLms\Cart\Models\Product | 2 |
Example
- Create user submission like this:
POST /api/admin/user-submissions
{
"email": "test@email.com",
"morphable_id": 2,
"morphable_type": "EscolaLms\\Cart\\Models\\Product"
}
- Create a new account.
- The product is assigned to your account.
Endpoints
All the endpoints are defined in swagger
👁 swagger
Tests
Run ./vendor/bin/phpunit to run tests. See tests folder as it's quite good staring point as documentation appendix.
Test details
👁 codecov
👁 Tests PHPUnit in environments
Events
AssignToProduct- event dispatched after assigning user to product.AssignToProductable- event dispatched after assigning user to productable model.
Listeners
AccountRegisteredListener- listens to newly created accounts.
How to use this on frontend.
Admin panel
List of user submissions
👁 List of user submissions
Permissions
Permissions are defined in seeder
