protected function registerBladeDirectives()
    {
        // Set up the cms_script directive
        Blade::directive('cms_script', function () {
            return "<?php ob_start(); ?>";
        });

        Blade::directive('cms_endscript', function () {
            return "<?php app(Czim\\CmsCore\\Contracts\\Support\\View\\AssetManagerInterface::class)"
                 . "->registerScript(ob_get_clean(), false); ?>";
        });


        // Set up the cms_scriptonce directive
        Blade::directive('cms_scriptonce', function () {
            return "<?php ob_start(); ?>";
        });

        Blade::directive('cms_endscriptonce', function () {
            return "<?php app(Czim\\CmsCore\\Contracts\\Support\\View\\AssetManagerInterface::class)"
                 . "->registerScript(ob_get_clean(), true); ?>";
        });


        // Set up the cms_scriptassethead directive
        Blade::directive('cms_scriptassethead', function ($expression) {

            if ($this->isBladeArgumentStringBracketed()) {
                $expression = substr($expression, 1, -1);
            }

            return "<?php app(Czim\\CmsCore\\Contracts\\Support\\View\\AssetManagerInterface::class)"
                . "->registerScriptAsset({$expression}, true); ?>";
        });


        // Set up the cms_scriptasset directive
        Blade::directive('cms_scriptasset', function ($expression) {
            return "<?php app(Czim\\CmsCore\\Contracts\\Support\\View\\AssetManagerInterface::class)"
                . "->registerScriptAsset"
                . ($this->isBladeArgumentStringBracketed() ? $expression : "({$expression})") . "; ?>";
        });


        // Set up the cms_style directive
        Blade::directive('cms_style', function ($expression) {
            return "<?php app(Czim\\CmsCore\\Contracts\\Support\\View\\AssetManagerInterface::class)"
                . "->registerStyleAsset"
                . ($this->isBladeArgumentStringBracketed() ? $expression : "({$expression})") . "; ?>";
        });
    }