[Vuejs]-Need to send request to backend api (LARAVEL) on specific route VUE

0👍

You can return json response like this.

$roles = Role::whereNotIn('id', [1])->get();
return response()->json(['roles' => $roles]);

In after getting response, you can use response.roles to get all roles in vue js.

Leave a comment