# Debugbar for Slim3

**URL:** <https://discourse.slimframework.com/t/debugbar-for-slim3/158>\
**Category:** Questions\
**Created:** [April 20, 2016, 11:49pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158 "2016-04-20T23:49:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [April 20, 2016, 11:49pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/1 "2016-04-20T23:49:54Z")

</div>

Hi,

does anybody know of a debugbar for Slim 3 which is readily installable via composer?

Thanks for any pointers

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [April 21, 2016, 11:56am UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/2 "2016-04-21T11:56:56Z")

</div>

I’ve been using [Tracy](https://github.com/nette/tracy) and it works quite well. I’m also using it as Slim’s error handler and wrote a little middleware for it to dump form data into the debugbar. I’ve been planning to write some docs about using it with Slim, but just haven’t gotten around to it yet. Let me know if you need any help with it.

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [April 22, 2016, 8:02am UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/3 "2016-04-22T08:02:47Z")

</div>

Thanks a lot for that link, Tracy looks nice, I’ll give it a try.

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [April 22, 2016, 4:40pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/4 "2016-04-22T16:40:14Z")

</div>

OK, Tracy basically seems quite nice. 2 questions though:

1. It doesn’t seem to catch my DB calls though (the github page shows and example of how it can do that). Any ideas why this might not be the case. BTW, I’m using Eloquent ORM.

2. Any chance you could share your middleware, even if it’s not 100% done yet? I’m having a project here with some relatively inexperienced developers and any debug info we can capture on the fly would be of help.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [April 22, 2016, 5:25pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/5 "2016-04-22T17:25:43Z")

</div>

1. The example they show is using data from the framework itself. To do that with Eloquent, you would likely need to add some sort of event handler to listen for Eloquent’s queries, then log them. I know there is an [Illuminate Component event listener/dispatcher](https://github.com/illuminate/events), so perhaps that might work to catch them. You would then probably want to follow the [Tracy directions to add a panel](https://tracy.nette.org/en/extensions) to the debugbar. I was going to do this at one time, but settled to just turn on the database log itself.

2. Sure, have a look at [this gist](https://gist.github.com/tflight/fb87eb5efce6e7e8908b9e2b5575b9d7).

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [April 22, 2016, 5:37pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/6 "2016-04-22T17:37:10Z")

</div>

Thanks a lot on both fronts; your help is highly appreciated. If I come up with something useful, I’ll be sure to share it.

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [April 22, 2016, 5:43pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/7 "2016-04-22T17:43:39Z")

</div>

Happy to help! 🙂

You might have noticed, but Tracy comes with a nice error handler too. You can unset Slim’s to take full advantage of it. So wherever you are enabling Tracy…

```
unset($app->getContainer()['errorHandler']);
Tracy\Debugger::enable();
```

---

<div class="post-metadata">

**Author:** ![augusthur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/augusthur/32/76_2.png) [@augusthur](https://discourse.slimframework.com/u/augusthur)\
**Post date:** [April 23, 2016, 4:28am UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/8 "2016-04-23T04:28:05Z")

</div>

If someone likes [PHP Debug Bar](http://phpdebugbar.com/) more than Tracy, I’m making a Slim Starter Kit using it. It also uses Eloquent. Link to the repo: [https://github.com/augusthur/slim-starter-kit](https://github.com/augusthur/slim-starter-kit)

Sorry for the lack of documentation. I was using it just for personal projects but now I’m posting it because it could help you. I’ll work on make it more understandable in the future.

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [April 24, 2016, 9:59pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/9 "2016-04-24T21:59:13Z")

</div>

Thanks, I’ll be sure to take a look.

---

<div class="post-metadata">

**Author:** ![1f7](https://avatars.discourse-cdn.com/v4/letter/1/91b2a8/32.png) [@1f7](https://discourse.slimframework.com/u/1f7)\
**Post date:** [April 30, 2016, 5:10pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/10 "2016-04-30T17:10:36Z")

</div>

Hello everybody  
Maybe someone will be interesting integration Tracy with Eloquent in Slim 3  
if desired, you can not use a table and display only raw data  
in this table not add bindings but for now i not interest it  
 ![](https://canada1.discourse-cdn.com/flex030/uploads/slimframework/original/1X/a2c929329d9a6389b8ffee4ffd9fce2ff51b316b.png)

as make gist link will be added

ok, [Slim 3 / Eloquent / Tracy gist](https://gist.github.com/1f7/b2d2846777e71f48e43a2ef7acc0a655)

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [April 30, 2016, 9:10pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/11 "2016-04-30T21:10:30Z")

</div>

A gist for this would be highly appreciated. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![1f7](https://avatars.discourse-cdn.com/v4/letter/1/91b2a8/32.png) [@1f7](https://discourse.slimframework.com/u/1f7)\
**Post date:** [July 25, 2016, 5:43pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/12 "2016-07-25T17:43:33Z")

</div>

Hello everybody  
another a very simple solution using Twig\_Profiler\_Dumper\_Html  
I have not found a decent Twig svg logo so just use text label in panel

![](https://canada1.discourse-cdn.com/flex030/uploads/slimframework/original/1X/f285912f349913e90c34c70882ea4ad7b43ddd5c.png)

if interested, [see gist](https://gist.github.com/1f7/7f3648598677073ce8d5dd7ab6fd152a)

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [July 25, 2016, 6:24pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/13 "2016-07-25T18:24:56Z")

</div>

Nice, thank you! 🙂

---

<div class="post-metadata">

**Author:** ![1f7](https://avatars.discourse-cdn.com/v4/letter/1/91b2a8/32.png) [@1f7](https://discourse.slimframework.com/u/1f7)\
**Post date:** [September 1, 2016, 3:54am UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/14 "2016-09-01T03:54:05Z")

</div>

added bindings, gist updated

 ![](https://canada1.discourse-cdn.com/flex030/uploads/slimframework/original/1X/0430592dd255abd2721b50f3abf0ede6573557a7.png)

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [September 1, 2016, 2:22pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/15 "2016-09-01T14:22:49Z")

</div>

@1f7, any thoughts of putting this out as a package?

---

<div class="post-metadata">

**Author:** ![TheLobos](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheLobos](https://discourse.slimframework.com/u/TheLobos)\
**Post date:** [September 1, 2016, 2:36pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/16 "2016-09-01T14:36:27Z")

</div>

I have some (IMHO cool) additions for this and have a package pretty much ready. Give me a few days to get organized and I can put it all together (unless someone else wants to do this).

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [September 1, 2016, 2:44pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/17 "2016-09-01T14:44:13Z")

</div>

Nice, I’d happy to help and have some possible addings/configs as well.

---

<div class="post-metadata">

**Author:** ![1f7](https://avatars.discourse-cdn.com/v4/letter/1/91b2a8/32.png) [@1f7](https://discourse.slimframework.com/u/1f7)\
**Post date:** [September 1, 2016, 3:47pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/18 "2016-09-01T15:47:10Z")

</div>

> [@tflight](#):
>
> thoughts of putting this out as a package

Hi @tflight, no problem but for which skeleton?  
package need config, config need skeleton.  
i use [skeleton](https://bitbucket.org/1f7/runcmf-skeleton) with dir structure based on symfony.  
and begin build [cmf](https://bitbucket.org/1f7/runcmf) with this.

> [@TheLobos](#):
>
> Give me a few days to get organized and I can put it all together (unless someone else wants to do this).

ok, wait you and support too if it is not conflict with my structure

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [September 1, 2016, 4:22pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/19 "2016-09-01T16:22:34Z")

</div>

> [@1f7](#):
>
> but for which skeleton?package need config, config need skeleton.

It should be fairly generic to work with most any Skeleton or Slim project. Taking a quick look, `TracyDBMiddleware` just needs an instance of `\Illuminate\Database\Capsule\Manager` and `Twig_Profiler_Profile`. After pulling in the package with composer, all the user would need to do is add a `TracyDBMiddleware` definition to their container passing it the Capsule Manager and Twig Profiler. Then they would add the middleware to their app, route, or however they want. It could work with nearly any project with Twig and Eloquent. Could even make it optional to use just the Twig panel, just the Eloquent panel, or both.

We’re essentially providing a middleware, which expects its config from the container. Not too different from how [this Auth middleware](https://github.com/tuupola/slim-basic-auth) from @tuupola gets setup and configured, independent of any specific skeleton.

---

<div class="post-metadata">

**Author:** ![1f7](https://avatars.discourse-cdn.com/v4/letter/1/91b2a8/32.png) [@1f7](https://discourse.slimframework.com/u/1f7)\
**Post date:** [September 1, 2016, 5:56pm UTC](https://discourse.slimframework.com/t/debugbar-for-slim3/158/20 "2016-09-01T17:56:19Z")

</div>

in general, you’re right

[Next page](https://discourse.slimframework.com/t/debugbar-for-slim3/158.md?page=2)
