S
S
Speakermen2020-07-15 04:28:12
Laravel
Speakermen, 2020-07-15 04:28:12

How to distribute the roles of Laravel and Vue?

Good day colleagues. Just getting started with Laravel and Vue. Wasted time on bikes. Very interesting to know.

Let's say I have a VKontakte attack template. Header and left menu I have a static wall and so on will be dynamic. I will write, for example, validation in the backend, error output on sessions in the routers folder in the web.

And here an interesting question begins if I want to use the history api, then where should I generate the html fragment on the front or back? And in what format can json or html be? Axios cool routing is a component for vue? If ajax then in the lark use in the routers folder to write routes in the api and not in the web?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Darkhan Kamaliev, 2020-07-15
@Speakermen

I beg you not to interfere with vue and blade, in your laravel mix the final bundle will turn out to be 5 meters and this will be a problem.
Laravel acts only as a REST API, Vue is a separate front, no one knows anything about each other.
Don't masturbate.
Make roles on the backend (for example, laravel spatie - permission), send a list of roles to the front and validate on the back.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question