Debug an octobercms plugin

Viewing the blog post

Posted in Octobercms on Mar 24, 2018

Snapshot of the Debugbar plugin


Just a quick outline of basic steps in debugging a plugin you have installed or defined yourself in my case.

In my case I'm using the bedard Debugbar plugin installed through the October CMS plugin system.

To get the debugbar displayed you will need turn APP_DEBUG in your config/app.php file to true or the preferred way, if you have defined your .env, then change the respective entry in there.

'debug' => env('APP_DEBUG', true)

Next in your plugin you will need to add the use case.

use Debugbar;

You will now be able to use the standard debugbar functions.

Debugbar::info($data);

Output messages in your twig code.

{{ debug() }}
{{ debug(user, categories) }}

I additionally had problems displaying information due to the log file not having the correct permissions, I needed to set the following directory permissions.

chmod 777 storage
chmod 777 logs