Reputation: 1056
I have been trying since weeks now to debug my laravel/vuejs app with absolutely no success, so I am trying to understand what happens . I am debugging the "old way", displaying errors manually... And I get a bit crazy :)
PHP debugbar seems fabulous but for some reason it only shows up when I have a 404 error... I Would like to see it all the time.
Also, "dd()" juste doesnt do anything when I do for example:
public function emailexists(string $email){
dd($email);
//this doesn't work either
var_dump($email);
die();
}
I guess there is something I forgot. I am a beginner with PHP.
EDIT: could it be because I am using VueJS ?
EDIT2: after Thomas' answer : I guess the lifecycle is ended correctly (unless I need to do something specific? I am just calling my PHP controller through axios from my vueJS view)
But here is my view.blade, could it be the issue?
@extends('template')
@section('content')
<div id="app">
<vuecomponent ></vuecomponent >
</div>
@endsection
Upvotes: 1
Views: 1103
Reputation: 193
When you use PHP, Laravel or Vuejs all dd() or var_dump() would be useful if you can track your requests. May you just need to use a browser inspector which could show you requests responses.
Upvotes: 0
Reputation: 9381
The debugbar gets added at the end of the request lifecycle (after middleware). Failing to properly end the lifecycle the intended way will yield the result of not having a debugbar. Both dd
and die
are PHP functions that stop execution immediately.
As for VueJS:
Vue itself will not show the debugbar, just because Laravel is installed next to the Vue entrypoint. That doesn't have to be a problem if you use a (Blade) view to setup Vue. However if you bypass Laravel entirely on DOM output, that yes the debugbar won't be part of it.
Upvotes: 1