Is it possible to use blade functionality inside of a vue template?
An example would be if I wanted to create a 'Login-Form' component:
{code}
{{ csrf_field() }}
Nice thing to add is unlike regular JavaScript and HTML data-attributes the above code is removed from the dom so those who inspect your HTML will not see a json string of your data.
So a csrf="{{ csrf_token() }}" as a prop. Probably want errors and old data too. But then you probably should just use php normally or actually use ajax call.
@jekinney thanks for the great answer! I was thinking about things incorrectly. Next step is figuring out how to pass my PHP data into my Vue templates as data.
Its important to realize that using Blade is a once in an instantiation event. Once the code is emitted to the browser its done (Your javascript is active). You have no 2 way bindings to the server. The csrfToken example? What do you expect is being achieved? Blade is Wonderful for initializing your Javascript setup. You can dynamically organize and initialize your Javascript data structures. After that you need HTTP to dynamically update those data structures.