hi im trying to write some php code in vue js instance and components
some code like this :
<script>
window.Laravel = {};
window.Laravel.Auth = '{{ Auth::check() }}' == '' ? false : true;
window.user = '{{ Auth::user()->name }}';
window.Laravel.csrfToken = '{{ csrf_token() }}'
</script>
its working in php document in < script > tag but i need to write this into "created()" in vue js lifecycle
const app = new Vue({
el: '#content',
created(){
window.user = '{{ Auth::user()->name }}';
}
});
tnx