Sage 10 Debugging Helpers

Hello Everyone,

In Sage 9 we have this helpers called @debug which allows us to be able to see what available methods and variables are in a view/template/page.

I’m just wondering if sage 10 has a similar helper? because i have tried @debug it doesn’t do anything at all.

Because currently I’m facing an Undefined variable issue when the variable is defined in app\View\Composers\App.php and is accessible to any views

protected static $views = [
'*',
'*.*'
];
/**
     * Data to be passed to view before rendering.
     *
     * @return array
     */
    public function with()
    {
        return [
            'siteName' => $this->siteName(),
            'siteBreadcrumbs' => $this->siteBreadcrumbs(),
            'copy_right_text' => $this->copyRightText(),
            'featured_image' => $this->featuredImage(),
            'menu_items' => $this->menuItems(),
            'site_languages' => $this->siteLanguages(),
            'current_language' => $this->currentLanguage(),
        ];
    }

Not sure about the @debug-directive (which I hadn’t heard of before) but $__data gives you all available variables in the blade file. So you can do for example {!! dd($__data) !!} .

4 Likes