Salut les gens,

j'ai commencé à utilisé c'est derniers temps Laravel 5 quand j'ai voulu avoir un genre de DebugKit pour ce dernier j'ai trouver Laravel DebugBar

j'ai tout fais comme le décrit par l'auteur du Plugin le code est bien injecté dans l'HTML mais rien n'est afficher dans la page

voici le code HTML

    <link rel="stylesheet" type="text/css" href="//localhost:3000/_debugbar/assets/stylesheets?1424341599">
    <script type="text/javascript" src="//localhost:3000/_debugbar/assets/javascript?1423122680"></script>
    <script type="text/javascript">jQuery.noConflict(true);</script>
    <script type="text/javascript">
    var phpdebugbar = new PhpDebugBar.DebugBar();
    phpdebugbar.addTab("messages", new PhpDebugBar.DebugBar.Tab({"icon":"list-alt","title":"Messages", "widget": new PhpDebugBar.Widgets.MessagesWidget()}));
    phpdebugbar.addIndicator("time", new PhpDebugBar.DebugBar.Indicator({"icon":"clock-o","tooltip":"Request Duration"}), "right");
    phpdebugbar.addTab("timeline", new PhpDebugBar.DebugBar.Tab({"icon":"tasks","title":"Timeline", "widget": new PhpDebugBar.Widgets.TimelineWidget()}));
    phpdebugbar.addIndicator("memory", new PhpDebugBar.DebugBar.Indicator({"icon":"cogs","tooltip":"Memory Usage"}), "right");
    phpdebugbar.addTab("exceptions", new PhpDebugBar.DebugBar.Tab({"icon":"bug","title":"Exceptions", "widget": new PhpDebugBar.Widgets.ExceptionsWidget()}));
    phpdebugbar.addTab("views", new PhpDebugBar.DebugBar.Tab({"icon":"leaf","title":"Views", "widget": new PhpDebugBar.Widgets.TemplatesWidget()}));
    phpdebugbar.addTab("route", new PhpDebugBar.DebugBar.Tab({"icon":"share","title":"Route", "widget": new PhpDebugBar.Widgets.VariableListWidget()}));
    phpdebugbar.addIndicator("currentroute", new PhpDebugBar.DebugBar.Indicator({"icon":"share","tooltip":"Route"}), "right");
    phpdebugbar.addTab("queries", new PhpDebugBar.DebugBar.Tab({"icon":"inbox","title":"Queries", "widget": new PhpDebugBar.Widgets.SQLQueriesWidget()}));
    phpdebugbar.addTab("emails", new PhpDebugBar.DebugBar.Tab({"icon":"inbox","title":"Mails", "widget": new PhpDebugBar.Widgets.MailsWidget()}));
    phpdebugbar.addTab("request", new PhpDebugBar.DebugBar.Tab({"icon":"tags","title":"Request", "widget": new PhpDebugBar.Widgets.VariableListWidget()}));
    phpdebugbar.setDataMap({
    "messages": ["messages.messages", []],
    "messages:badge": ["messages.count", null],
    "time": ["time.duration_str", '0ms'],
    "timeline": ["time", {}],
    "memory": ["memory.peak_usage_str", '0B'],
    "exceptions": ["exceptions.exceptions", []],
    "exceptions:badge": ["exceptions.count", null],
    "views": ["views", []],
    "views:badge": ["views.nb_templates", 0],
    "route": ["route", {}],
    "currentroute": ["route.uri", ],
    "queries": ["queries", []],
    "queries:badge": ["queries.nb_statements", 0],
    "emails": ["swiftmailer_mails.mails", []],
    "emails:badge": ["swiftmailer_mails.count", null],
    "request": ["request", {}]
    });
    phpdebugbar.restoreState();
    phpdebugbar.ajaxHandler = new PhpDebugBar.AjaxHandler(phpdebugbar);
    phpdebugbar.ajaxHandler.bindToXHR();
    phpdebugbar.setOpenHandler(new PhpDebugBar.OpenHandler({"url":"http:\/\/localhost:3000\/_debugbar\/open"}));
    phpdebugbar.addDataSet({"__meta":{"id":"8cb5e2faf2f57f11fcdb8a29f3191ce5","datetime":"2015-03-03 14:52:29","utime":1425394349.9364,"method":"GET","uri":"\/","ip":"127.0.0.1"},"php":{"version":"5.5.9-1ubuntu4.6"},"messages":{"count":0,"messages":[]},"time":{"start":1425394349.7899,"end":1425394349.9365,"duration":0.1466920375824,"duration_str":"146.69ms","measures":[{"label":"Booting","start":1425394349.7899,"relative_start":0,"end":1425394349.8942,"relative_end":1425394349.8942,"duration":0.10433292388916,"duration_str":"104.33ms","params":[],"collector":null},{"label":"Application","start":1425394349.9043,"relative_start":0.11441802978516,"end":1425394349.928,"relative_end":1425394349.928,"duration":0.02368688583374,"duration_str":"23.69ms","params":[],"collector":null},{"label":"After application","start":1425394349.928,"relative_start":0.13819289207458,"end":1425394349.9366,"relative_end":1.7881393432617e-5,"duration":0.0085170269012451,"duration_str":"8.52ms","params":[],"collector":null}]},"memory":{"peak_usage":2621440,"peak_usage_str":"2.5MB"},"exceptions":{"count":0,"exceptions":[]},"views":{"nb_templates":2,"templates":[{"name":"articles.index (resources\/views\/articles\/index.blade.php)","param_count":1,"params":["articles"],"type":"blade"},{"name":"app (resources\/views\/app.blade.php)","param_count":6,"params":["obLevel","__env","app","errors","articles","article"],"type":"blade"}]},"route":{"uri":"GET \/","controller":"App\\Http\\Controllers\\ArticlesController@index","namespace":"App\\Http\\Controllers","prefix":null,"where":[],"file":"app\/Http\/Controllers\/ArticlesController.php:15-20"},"queries":{"nb_statements":1,"nb_failed_statements":0,"accumulated_duration":0.00077,"accumulated_duration_str":"770\u03bcs","statements":[{"sql":"select * from `articles`","params":{"hints":"Use <code>SELECT *<\/code> only if you need all columns from table<br \/>The <code>SELECT<\/code> statement has no <code>WHERE<\/code> clause and could examine many more rows than intended"},"duration":0.00077,"duration_str":"770\u03bcs","stmt_id":null,"connection":"laravel_5"}]},"swiftmailer_mails":{"count":0,"mails":[]},"request":{"format":"html","content_type":"text\/html; charset=UTF-8","status_text":"OK","status_code":"200","request_query":"[]","request_request":"[]","request_headers":"array:10 [\n  \"cookie\" => array:1 [\n    0 => \"_ga=GA1.1.1596420886.1421518544; XSRF-TOKEN=eyJpdiI6IjQ3TldLakFcL1VNc3dBRzdiUlMzZXB3PT0iLCJ2YWx1ZSI6IllvN3FQUVwvMGk1TTVjTVdCeHo4SmVlNUI0OXdZUWRHSzFUQWJLVDZ2N3hSZGdiSkIycnd4dHhDYmZVUkJPYnVGSWQ1Qm4rNnVnT0JmNGM0UTRUOXZ6Zz09IiwibWFjIjoiZTg2NTE2YWU5YzM4MGUwMWU0YTQyOGQ3NjZmNzY5NjM4Y2IzNDZlZDQ2YTM0YmVlYmU5MDI4NDUyOGU0MDM0YiJ9; laravel_session=eyJpdiI6IjhQMHJGVlwvTHV1Y1NrK0d2SUVUQzZRPT0iLCJ2YWx1ZSI6IkRncWdCWTVuMWxOVG0zRjIwV1FSamQ2MzkyYW80eVNtdFwvbWtsQ2duSTREM25xZ0xRbVRTcTFhTGdJQTRueEpMMnNWejA2MElzUW5OWmcyMWlcLzBNc2c9PSIsIm1hYyI6IjlkMzdiOWViNWFmYjE0MmE3YmZmNjRhZWQ2MmZhNTFlOTUyN2JhZjgyMTdjOWJmNjY2ZmRiODFkYWFhYWU0MjkifQ==\"\n  ]\n  \"accept-language\" => array:1 [\n    0 => \"fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,ar;q=0.2\"\n  ]\n  \"accept-encoding\" => array:1 [\n    0 => \"identity\"\n  ]\n  \"referer\" => array:1 [\n    0 => \"http:\/\/localhost:3000\/\"\n  ]\n  \"user-agent\" => array:1 [\n    0 => \"Mozilla\/5.0 (X11; Linux i686) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/40.0.2214.115 Safari\/537.36\"\n  ]\n  \"accept\" => array:1 [\n    0 => \"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8\"\n  ]\n  \"cache-control\" => array:1 [\n    0 => \"max-age=0\"\n  ]\n  \"connection\" => array:1 [\n    0 => \"close\"\n  ]\n  \"host\" => array:1 [\n    0 => \"//localhost:3000/"\n  ]\n  \"agent\" => array:1 [\n    0 => \"false\"\n  ]\n]","request_server":"array:24 [\n  \"DOCUMENT_ROOT\" => \"\/home\/borhane\/Lab\/PhpLab\/laravel5\/public\"\n  \"REMOTE_ADDR\" => \"127.0.0.1\"\n  \"REMOTE_PORT\" => \"49985\"\n  \"SERVER_SOFTWARE\" => \"PHP 5.5.9-1ubuntu4.6 Development Server\"\n  \"SERVER_PROTOCOL\" => \"HTTP\/1.1\"\n  \"SERVER_NAME\" => \"localhost\"\n  \"SERVER_PORT\" => \"8000\"\n  \"REQUEST_URI\" => \"\/\"\n  \"REQUEST_METHOD\" => \"GET\"\n  \"SCRIPT_NAME\" => \"\/index.php\"\n  \"SCRIPT_FILENAME\" => \"\/home\/borhane\/Lab\/PhpLab\/laravel5\/public\/index.php\"\n  \"PHP_SELF\" => \"\/index.php\"\n  \"HTTP_COOKIE\" => \"_ga=GA1.1.1596420886.1421518544; XSRF-TOKEN=eyJpdiI6IjQ3TldLakFcL1VNc3dBRzdiUlMzZXB3PT0iLCJ2YWx1ZSI6IllvN3FQUVwvMGk1TTVjTVdCeHo4SmVlNUI0OXdZUWRHSzFUQWJLVDZ2N3hSZGdiSkIycnd4dHhDYmZVUkJPYnVGSWQ1Qm4rNnVnT0JmNGM0UTRUOXZ6Zz09IiwibWFjIjoiZTg2NTE2YWU5YzM4MGUwMWU0YTQyOGQ3NjZmNzY5NjM4Y2IzNDZlZDQ2YTM0YmVlYmU5MDI4NDUyOGU0MDM0YiJ9; laravel_session=eyJpdiI6IjhQMHJGVlwvTHV1Y1NrK0d2SUVUQzZRPT0iLCJ2YWx1ZSI6IkRncWdCWTVuMWxOVG0zRjIwV1FSamQ2MzkyYW80eVNtdFwvbWtsQ2duSTREM25xZ0xRbVRTcTFhTGdJQTRueEpMMnNWejA2MElzUW5OWmcyMWlcLzBNc2c9PSIsIm1hYyI6IjlkMzdiOWViNWFmYjE0MmE3YmZmNjRhZWQ2MmZhNTFlOTUyN2JhZjgyMTdjOWJmNjY2ZmRiODFkYWFhYWU0MjkifQ==\"\n  \"HTTP_ACCEPT_LANGUAGE\" => \"fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,ar;q=0.2\"\n  \"HTTP_ACCEPT_ENCODING\" => \"identity\"\n  \"HTTP_REFERER\" => \"http:\/\/localhost:3000\/\"\n  \"HTTP_USER_AGENT\" => \"Mozilla\/5.0 (X11; Linux i686) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/40.0.2214.115 Safari\/537.36\"\n  \"HTTP_ACCEPT\" => \"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8\"\n  \"HTTP_CACHE_CONTROL\" => \"max-age=0\"\n  \"HTTP_CONNECTION\" => \"close\"\n  \"HTTP_HOST\" => \"//localhost:3000/"\n  \"HTTP_AGENT\" => \"false\"\n  \"REQUEST_TIME_FLOAT\" => 1425394349.7897\n  \"REQUEST_TIME\" => 1425394349\n]","request_cookies":"array:3 [\n  \"_ga\" => null\n  \"XSRF-TOKEN\" => \"i6XyLJnKEW593NniXOzGkdQhzvLsxj3BGWl7y7rH\"\n  \"laravel_session\" => \"59bc0408445fdf9440756b5216f66109ecc5a762\"\n]","response_headers":"array:3 [\n  \"cache-control\" => array:1 [\n    0 => \"no-cache\"\n  ]\n  \"date\" => array:1 [\n    0 => \"Tue, 03 Mar 2015 14:52:29 GMT\"\n  ]\n  \"content-type\" => array:1 [\n    0 => \"text\/html; charset=UTF-8\"\n  ]\n]","path_info":"\/","session_attributes":"array:4 [\n  \"flash\" => array:2 [\n    \"old\" => []\n    \"new\" => []\n  ]\n  \"_token\" => \"i6XyLJnKEW593NniXOzGkdQhzvLsxj3BGWl7y7rH\"\n  \"_previous\" => array:1 [\n    \"url\" => \"http:\/\/localhost:3000\/_debugbar\/assets\/javascript?1423122680\"\n  ]\n  \"PHPDEBUGBAR_STACK_DATA\" => []\n]"}}, "8cb5e2faf2f57f11fcdb8a29f3191ce5");

    </script>

PS:

la console de Chrome affiche une erreur :

    Uncaught SyntaxError: Unexpected token ILLEGAL

2 réponses


Borhaneddine GUEMIDI
Auteur
Réponse acceptée

Reiku c'est bon le problème est réglé c'est a cause de Browser Sync j'ai pas trop compris pourquoi ?

Bonjour Big B,

Normalement pour installer ce plugin tu as juste a l'installer via composer et ensuite ajouter dans le tableau "providers" du fichier /config/app.php la ligne suivant :

'Barryvdh\Debugbar\ServiceProvider',

Ni plus ni moins.

Cordialement,
Reiku