[Vuejs]-Laravel and Vue – Passing auth()->user()->name to Vue template returns non-object

0👍

Okay I made an alternative way to make it work without the <script>

User Model

  protected $with = ['roles', 'permissions'];

API

 Route::get('user', function (Request $request) {
    return $request->user();
  });

Leave a comment