Kirby3 Toilet
Dump without stopping your thread or template rendering. Instead your dumps will go straight to the new Toilet panel area. There you can inspect them and flush when you are done debugging. Don't forget to wash your hands!
Notes
This project was inspired by Spatie's Ray and Laravel's Telescope. It borrows some of Telescope's code to trigger the interactive bits of the dumps on the panel area.
Installation
With Composer
composer require sietseveenman/kirby3-toilet
Usage
Use the poop() method anywhere.
$articles = $page->children();
poop( $articles );
poop() returns the passed variable so you can chain methods and keep your code running.
foreach( poop($articles), $item) {
<a href="<?= $item->url() ?>"><?= $item->title() ?></a>
}
poop($payment)->isSuccessful()->doStuff();
Config
// site/config.php
return [
'sietseveenman.kirby3-toilet' => [
// Customize the timeout duration for loading fresh dumps.
// Default = 2000
'poop-timeout' => 500,
// Dump in silence if you want to.
// Default = false
'muted' => true,
// Set permission for user roles to use the toilet.
// Default = ['admin']
'roles' => ['developer', 'vegan'],
],
];