Laravel Tracy 1.8.5 版
Nette Tracy for Laravel 5
Better Laravel Exception Handler
Features
- Visualization of errors and exceptions
- Debugger Bar (ajax support @v1.5.6)
- Exception stack trace contains values of all method arguments.
Online Demo
Installing
To get the latest version of Laravel Exceptions, simply require the project using Composer:
composer require recca0120/laravel-tracy
Instead, you may of course manually update your require block and run composer update
if you so choose:
{
"require": {
"recca0120/laravel-tracy": "^1.7.13"
}
}
Include the service provider within config/app.php
. The service povider is needed for the generator artisan command.
'providers' => [
...
Recca0120\LaravelTracy\LaravelTracyServiceProvider::class,
...
];
publish
php artisan vendor:publish --provider="Recca0120\LaravelTracy\LaravelTracyServiceProvider"
Config
return [
'enabled' => env('APP_DEBUG') === true,
'showBar' => env('APP_ENV') !== 'production',
'accepts' => [
'text/html',
],
// appendTo: body | html
'appendTo' => 'body',
'editor' => 'subl://open?url=file://%file&line=%line',
'maxDepth' => 4,
'maxLength' => 1000,
'scream' => true,
'showLocation' => true,
'strictMode' => true,
'panels' => [
'routing' => true,
'database' => true,
'view' => true,
'event' => false,
'session' => true,
'request' => true,
'auth' => true,
'html-validator' => true,
'terminal' => true,
],
];
Editor Link
windows
copy <vendor path>/recca0120/laravel-tracy/tools/subl-handler/subl-handler.vbs to any directory where you want to place
double click subl-handler.vbs and select editor (support eclipse, sublime, notepad++, else...)
OSX
https://github.com/dhoulb/subl
Prefer PhpStorm, you can edit config/tracy.php
's key of editor
like this:
'editor' => 'phpstorm://open?file=%file&line=%line',
Debugger Bar
Directive bdump
Ajax Debugger Bar
SystemInfo
Route
View
Session
Request
Auth
Custom Auth
// app/Providers/AppServiceProvider.php
namespace App\Providers;
use Recca0120\LaravelTracy\BarManager;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(BarManager $barManager)
{
$barManager->get('auth')->setUserResolver(function() {
return [
'id' => 'xxx',
'username' => 'xxx',
...
];
});
}
}
Html Validator
Web Artisan
web artisan is another package recca0120/terminal
notice
if you install terminal before, this panel will throw errors, please remove folder app/resources/views/vendor/terminal
STANDALONE
require __DIR__.'/../vendor/autoload.php';
use Recca0120\LaravelTracy\Tracy;
// before outout
$tracy = Tracy::instance();
$authPanel = $tracy->getPanel('auth');
$authPanel->setUserResolver(function() {
return [
'email' => 'recca0120@gmail.com'
];
});
function sql($sql)
{
$tracy = Tracy::instance();
$databasePanel = $tracy->getPanel('database');
$databasePanel->logQuery($sql);
}
sql('select * from users');
sql('select * from news');
sql('select * from products');
可以試試atom + https://atom.io/packages/php-integrator-ba...
下個版本加入使用 console.log來顯示sql
這樣就能留在sql了
挺好的,ajax问题 1.5.6 好像还有。
@akphp 什麼樣的問題?
提示一下!
@recca0120 我用的 datatables , sql里都没有,是我使用不对吗。
配置是默认的
@akphp
這個問題在剛剛修復了...
1.5.8版被我改壞了,所以Ajax的部份全部失效
試看看1.5.9版,ajax就能正常顯示了
@nickfan
不好意思剛剛才看懂你的問題,參考以下連結..
atom
osx: https://github.com/WizardOfOgz/atom-handle...
windows: https://github.com/recca0120/laravel-tracy...
@recca0120 太好了,我去试试,谢谢