Skip to main content

All Questions

Tagged with
38 votes
6 answers
64k views

How to pass laravel CSRF token value to vue

I have this form where the user should only type text inside a text area: <form action="#" v-on:submit="postStatus">{{-- Name of the method in Vue.js --}} <div ...
Pathros's user avatar
  • 10.8k
26 votes
9 answers
62k views

Laravel 5.2 CORS, GET not working with preflight OPTIONS

The dreaded CORS Error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost/mysite/api/test. (Reason: CORS header 'Access-Control-Allow-...
suncoastkid's user avatar
  • 2,233
25 votes
2 answers
23k views

Vuejs js for multiple pages, not for a single page application

I need to build an application using laravel 5.3 and vuejs 2, because I need to use two-way binding rather than use jquery. I need to set up the views with blade templates. Then, I need to use vuejs ...
Dinuka Thilanga's user avatar
21 votes
4 answers
10k views

Using Laravel's Gate / Authorization in VueJs

I'm not sure how this hasn't been dealt with before, but how do I go about using VueJs and authorizing actions in Vue template? If I'm using Laravel's blade, this is easy (using @can directive), but ...
Steve Bauman's user avatar
  • 8,718
21 votes
3 answers
11k views

Using Vue.js in Laravel 5.3

In Laravel projects prior to 5.3 I've utilised Vue.js using the script tag like this: <script type="text/javascript" src="../js/vue.js"></script> I would then create a Vue instance ...
haakym's user avatar
  • 12.4k
21 votes
3 answers
44k views

[Vue warn]: Cannot find element: #app

I have a fresh installed laravel project with all the components updated. All I did is tried to add app.js in my welcome.blade.php file, after adding the following I get this error [Vue warn]: ...
silverFoxA's user avatar
  • 4,667
16 votes
1 answer
54k views

Why am I getting a 422 error code?

I am making a POST request, but unable to get anything besides a 422 response. Vue.js client code: new Vue({ el: '#app', data: { form: { companyName: '', street: '', city: ...
Donnie's user avatar
  • 6,351
16 votes
2 answers
6k views

Google Sign-in in vuejs spa and laravel api

I have a single page application with vue.js that uses Laravel 5.5 as its api. I want to add google sign-in to it but I am confused as where to start. I have used laravel socialite before to add ...
Ragas's user avatar
  • 3,235
15 votes
4 answers
5k views

How to use Laravel helper functions with Vue?

Iam bulding a multi-page app using Laravel and Vue.Now, for example lets say I want to use some Laravel helper function like {{ trans('messages.welcome') }} inside a Vue component (which is in a ...
rook's user avatar
  • 1,164
14 votes
6 answers
23k views

Force logout of all users in Laravel [duplicate]

How can I force all users to be logged out in a SPA? I want it so that when I deploy a new version, all users automatically get logged out. I tried the following, but I'm not sure if it's the safest ...
nikospap's user avatar
  • 211
13 votes
4 answers
3k views

Laravel Passport middleware protected routes "Unauthenticated" problem

I am using Laravel Passport for the authentication, so I put my routes into middleware protection. UPDATED To make it clear, I am adding UsersController too. public function getUser() { $...
user avatar
12 votes
2 answers
5k views

HTML Tags containing Vue.js v-if and v-for directives flash at loading

I use Vue.js to send data to a basic and very simple API that subscribes an e-mail address to a newsletter via the form below and to display some messages (state and errors). I use in particularly ...
louisfischer's user avatar
  • 2,084
12 votes
4 answers
2k views

Inform user that message is still being typed

I am using Laravel 5.6.7, Socket.IO and vue.js. I am not using Pusher and redis. Below is my code to send message to user chatting with me one to one. var url = "http://localhost:6001/apps/My_appId/...
Pankaj's user avatar
  • 10.1k
11 votes
3 answers
2k views

Laravel class access in Vue.js

I have the following class where I defined my Minimum/Maximum length values: class MinMaxValuesUser { const Min_UserName = 6; const Max_UserName = 30; } Below is the rule in request class ...
Pankaj's user avatar
  • 10.1k

15 30 50 per page
1
2 3 4 5
30