File tree Expand file tree Collapse file tree
user_guide_src/source/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,13 +62,14 @@ Create the model first at **app/Models/UserModel.php** so that we can interact w
6262
6363The model uses the ``users `` table in the database for all of its activities.
6464
65- We've set the ``$allowedFields `` property
66- to include all of the fields that we want outside classes to change. The ``id ``, ``created_at ``, and ``updated_at `` fields
67- are handled automatically by the class or the database, so we don't want to change those.
68-
69- Finally, we've set our Entity
70- class as the ``$returnType ``. This ensures that all methods on the model that return rows from the database will return
71- instances of our User Entity class instead of an object or array like normal.
65+ We've set the ``$allowedFields `` property to include all of the fields that we
66+ want outside classes to change. The ``id ``, ``created_at ``, and ``updated_at ``
67+ fields are handled automatically by the class or the database, so we don't want
68+ to change those.
69+
70+ Finally, we've set our Entity class as the ``$returnType ``. This ensures that all
71+ methods on the model that return rows from the database will return instances of
72+ our User Entity class instead of an object or array like normal.
7273
7374Working with the Entity Class
7475=============================
You can’t perform that action at this time.
0 commit comments