Answer the question
In order to leave comments, you need to log in
How to make a helper for View or how to call a method there?
Hello members!
How is it architecturally correct to make it so that in the view it would be possible to call the method of the helper object (it has already been written), which returns a string (in my case, generating a set of fields of dynamic properties of an entity)?
I really don’t want to receive this string in the action and pass it to the view, I believe that this is the view’s area of responsibility and this is where my miracle method should be called.
Answer the question
In order to leave comments, you need to log in
https://laravel.com/docs/master/views#view-composers
or just a static helper class
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question