Package: assign-without-account
Generated from api/packages/assign-without-account
Source: api/packages/assign-without-account · imported version 0.1.18. The sections after the README are extracted from the code on every docs build.
README
Section titled “README”What does it do
Section titled “What does it do”The package is used to assign users without an account.
Installing
Section titled “Installing”composer require ulams/assing-without-accountphp artisan migratephp artisan db:seed --class="Ulams\AssignWithoutAccount\Database\Seeders\AssignWitoutAccountPermissionSeeder"
Requirements
Section titled “Requirements”You need to define email templates in the Templates package for AssignToProduct and AssignToProductable events.
Database
Section titled “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 | Ulams\Cart\Models\Product | 2 |
Example
Section titled “Example”- Create user submission like this:
POST /api/admin/user-submissions{ "email": "test@email.com", "morphable_id": 2, "morphable_type": "Ulams\\Cart\\Models\\Product"}- Create a new account.
- The product is assigned to your account.
Endpoints
Section titled “Endpoints”All the endpoints are defined in swagger
Run ./vendor/bin/phpunit to run tests. See tests folder as it’s quite good staring point as documentation appendix.
Test details
Events
Section titled “Events”AssignToProduct- event dispatched after assigning user to product.AssignToProductable- event dispatched after assigning user to productable model.
Listeners
Section titled “Listeners”AccountRegisteredListener- listens to newly created accounts.
How to use this on frontend.
Section titled “How to use this on frontend.”Admin panel
Section titled “Admin panel”List of user submissions

Permissions
Section titled “Permissions”Permissions are defined in seeder
More documentation in the package
Section titled “More documentation in the package”API endpoints
Section titled “API endpoints”| Method | Path | Auth | Action |
|---|---|---|---|
GET |
/api/admin/user-submissions |
yes | UserSubmissionAdminController@index |
POST |
/api/admin/user-submissions |
yes | UserSubmissionAdminController@create |
PUT |
/api/admin/user-submissions/{id} |
yes | UserSubmissionAdminController@update |
DELETE |
/api/admin/user-submissions/{id} |
yes | UserSubmissionAdminController@delete |
Permissions
Section titled “Permissions”| Permission | Seeded for roles | Constant |
|---|---|---|
assign-without-account_user-submission_list |
admin | AssignWithoutAccountPermissionEnum::USER_SUBMISSION_LIST |
assign-without-account_user-submission_create |
admin | AssignWithoutAccountPermissionEnum::USER_SUBMISSION_CREATE |
assign-without-account_user-submission_update |
admin | AssignWithoutAccountPermissionEnum::USER_SUBMISSION_UPDATE |
assign-without-account_user-submission_delete |
admin | AssignWithoutAccountPermissionEnum::USER_SUBMISSION_DELETE |
Settings
Section titled “Settings”Registered with AdministrableConfig::registerConfig (editable in the admin panel under Configuration → Settings).
None.
Events
Section titled “Events”| Event | Description | Notification templates |
|---|---|---|
AssignToProduct |
||
AssignToProductable |
||
UnassignProduct |
||
UnassignProductable |
Notification templates registered here
Section titled “Notification templates registered here”None.
Artisan commands
Section titled “Artisan commands”None.
Scheduled jobs
Section titled “Scheduled jobs”None.
Environment variables read
Section titled “Environment variables read”None.