I
I
Ivan Huk2020-09-01 15:31:45
ORM
Ivan Huk, 2020-09-01 15:31:45

How to create dynamic property in orm laravel?

There is a User table and a Roles

table in the Roles name of the roles (for example, manager, admin),

both models are connected,

you need to create a dynamic property in the user model ( isAdmin or isManager ) in accordance with what the relationship will return

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question