Answer the question
In order to leave comments, you need to log in
how to pass variable from laravel to vue?
Hello! I'm making a SPA application on laravel + vue, I had such a question, there is a table
In which the type is written for a specific number, for example 1 is Admin, 2 is user. With the usual approach (not SPA), I would simply write
return view('base', ['userTypes' => User::getUserTypes()]);
{% if entity.active in userTypes|keys %}{{ userTypes[entity.active] }}{% endif %}
this piece of code is taken from the symphony to show what I would roughly do next. How can I pass a variable to a view? What would do a similar trick?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question