escolalms / assign-without-account
Escola Headless LMS Assign without account
Installs: 7 915
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:package
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
README
What does it do
The package is used to assign users without an account.
Installing
composer require escolalms/assing-without-account
php artisan migrate
php 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
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
Tests
Run ./vendor/bin/phpunit
to run tests. See tests folder as it's quite good staring point as documentation appendix.
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
Permissions
Permissions are defined in seeder