saas-boilerplate icon indicating copy to clipboard operation
saas-boilerplate copied to clipboard

Cannot create admin-root user

Open qcz-cell opened this issue 3 years ago • 5 comments

After I execute the "php artisan admin:assign-role myEmail slug" command, I get an error "WHOOPS! We could not assign user a role because: No query results for model [Designer\Domain\Users\Models\ user]."

The name of my "App" is "Designer".

qcz-cell avatar Jul 12 '21 06:07 qcz-cell

Did you create a user account with the email you're assigning as admin?

On 9:48AM, Mon, 12 Jul 2021 Ares @.*** wrote:

After I execute the "php artisan admin:assign-role myEmail slug" command, I get an error "WHOOPS! We could not assign user a role because: No query results for model [Designer\Domain\Users\Models\ user]."

The name of my "App" is "Designer".

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/miracuthbert/saas-boilerplate/issues/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDREDICSTSOEXFZICUUOR3TXKF2NANCNFSM5AGGITRA .

miracuthbert avatar Jul 15 '21 20:07 miracuthbert

The role definition is not in the script I just installed.

Any advise?

LawrenceAddo avatar Oct 04 '22 15:10 LawrenceAddo

php artisan role:assign [email protected] admin-root. ( i changed with my email )

the result is

Invalid user credentials.

role admin-root is correctly in the roles table

i tried again after creating user via the signup link

and this is the error


  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'permitable_id' in 'field list' (SQL: insert into `user_roles` (`role_id`, `user_id`, `created_at`, `updated_at`, `expires_at`, `permitable_id`) values (2, 1, 2023-07-06 09:34:32, 2023-07-06 09:34:32, ?, ?))

the column is missing in the user_roles table...

something is not updated... the documentation... or the database...

boardmain avatar Jul 06 '23 09:07 boardmain

Make sure you have created an account with that email first

On Thu, Jul 6, 2023 at 12:30 PM samuele coppede @.***> wrote:

php artisan role:assign @.*** admin-root. ( i changed with my email )

the result is

Invalid user credentials.

role admin-root is correctly in the roles table

— Reply to this email directly, view it on GitHub https://github.com/miracuthbert/saas-boilerplate/issues/30#issuecomment-1623329034, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDREDPKMGIQUPTG2GBL2NLXO2ASPANCNFSM5AGGITRA . You are receiving this because you commented.Message ID: @.***>

miracuthbert avatar Jul 06 '23 15:07 miracuthbert

Some migrations are missing; can be fixed by publishing them

php artisan vendor:publish --tag=laravel-roles-permitable-migrations

Do not forget to run artisan migrate afterwards

miracuthbert avatar Jul 06 '23 16:07 miracuthbert