escolalms/assign-without-account

Escola Headless LMS Assign without account

0.1.18 2024-02-14 13:24 UTC

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-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

  1. user-submissions

Example

  1. Create user submission like this:
POST /api/admin/user-submissions
{
    "email": "test@email.com",
    "morphable_id": 2,
    "morphable_type": "EscolaLms\\Cart\\Models\\Product"
}
  1. Create a new account.
  2. 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

  1. AssignToProduct - event dispatched after assigning user to product.
  2. AssignToProductable - event dispatched after assigning user to productable model.

Listeners

  1. AccountRegisteredListener - listens to newly created accounts.

How to use this on frontend.

Admin panel

List of user submissions List of stationary events

Permissions

Permissions are defined in seeder