You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the user class you can define a readonly User (Data Transfer Object) or not and some defaults can be defined/assumed. This should allow one to make a couple of things (in my mind) happen, first to be able to pass an abstract class for $contents during the creation of the Response object. Therefore I think you could type hint more easily in the blade file. Also, it would allow backend developers to restrict or show more intent to a front end developer.
once again just a thought or an idea. this basically just achieves an immutable instance that cannot be changed in the blade file. guaranteeing a backend developer their design is carried through to the frontend.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible or would it make sense, to automate a class object passed into returned response in a controller through a function.
return response()->transformTo<json, etc>([$user, $customer, etc])
in the user class you can define a readonly User (Data Transfer Object) or not and some defaults can be defined/assumed. This should allow one to make a couple of things (in my mind) happen, first to be able to pass an abstract class for $contents during the creation of the Response object. Therefore I think you could type hint more easily in the blade file. Also, it would allow backend developers to restrict or show more intent to a front end developer.
once again just a thought or an idea. this basically just achieves an immutable instance that cannot be changed in the blade file. guaranteeing a backend developer their design is carried through to the frontend.
Beta Was this translation helpful? Give feedback.
All reactions