protected function requireInline($scripts, $afterLoad = null)
    {
        $config  = config('require_js');
        $main    = array_get($config, 'main', "");
        $default = array_get($config, 'default', []);
        $child   = array_get($default, 'childs', []);
        if (isset($default['childs'])) {
            unset($default['childs']);
        }

        $defaults = "'" . implode("','", $default) . "'";
        $childs   = "'" . implode("','", $child) . "'";


        $config = $this->requireJsCache();
        $inline = <<<EOD
            $config
            require(['$main'], function () {

                require(["jquery", "jquery-ui","moment", "jquery-ui-daterangepicker","datetimepicker", "qtip"], function ($) {
                
                    require([$defaults], function () {
                        require([$childs], function () {
                            $afterLoad
                        });
                    });
                });
          });      
           
EOD;
        return $inline;
    }