diff --git a/src/Http/Controllers/ThemesController.php b/src/Http/Controllers/ThemesController.php index 581aeae..db33084 100644 --- a/src/Http/Controllers/ThemesController.php +++ b/src/Http/Controllers/ThemesController.php @@ -1,12 +1,12 @@ hasMany('\Themes\Models\ThemeOptions', 'theme_id'); + return $this->hasMany('\DevDojo\Themes\Models\ThemeOptions', 'theme_id'); } } diff --git a/src/Models/ThemeOptions.php b/src/Models/ThemeOptions.php index b6883bb..98d0752 100644 --- a/src/Models/ThemeOptions.php +++ b/src/Models/ThemeOptions.php @@ -1,6 +1,6 @@ is(config('voyager.prefix')) || request()->is(config('voyager.prefix').'/*')) { $this->addThemesTable(); @@ -62,10 +63,10 @@ public function boot() if (Schema::hasTable('themes')) { $theme = $this->rescue(function () { - return \Themes\Models\Theme::where('active', '=', 1)->first(); + return \DevDojo\Themes\Models\Theme::where('active', '=', 1)->first(); }); if(Cookie::get('theme')){ - $theme_cookied = \Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); + $theme_cookied = \DevDojo\Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); if(isset($theme_cookied->id)){ $theme = $theme_cookied; } @@ -96,7 +97,7 @@ public function boot() */ public function addThemeRoutes($router) { - $namespacePrefix = '\\Themes\\Http\\Controllers\\'; + $namespacePrefix = '\\\DevDojo\\Themes\\Http\\Controllers\\'; $router->get('themes', ['uses' => $namespacePrefix.'ThemesController@index', 'as' => 'theme.index']); $router->get('themes/activate/{theme}', ['uses' => $namespacePrefix.'ThemesController@activate', 'as' => 'theme.activate']); $router->get('themes/options/{theme}', ['uses' => $namespacePrefix.'ThemesController@options', 'as' => 'theme.options']); @@ -165,7 +166,7 @@ private function loadDynamicMiddleware($themes_folder, $theme){ foreach($middleware_files as $middleware){ if($middleware != '.' && $middleware != '..'){ include($middleware_folder . '/' . $middleware); - $middleware_classname = 'Themes\\Middleware\\' . str_replace('.php', '', $middleware); + $middleware_classname = 'DevDojo\\Themes\\Middleware\\' . str_replace('.php', '', $middleware); if(class_exists($middleware_classname)){ // Dynamically Load The Middleware $this->app->make('Illuminate\Contracts\Http\Kernel')->prependMiddleware($middleware_classname); diff --git a/src/helpers.php b/src/helpers.php index 92b2e39..aaeecec 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -5,7 +5,7 @@ function theme_field($type, $key, $title, $content = '', $details = '', $placeholder = '', $required = 0){ - $theme = \Themes\Models\Theme::where('folder', '=', ACTIVE_THEME_FOLDER)->first(); + $theme = \DevDojo\Themes\Models\Theme::where('folder', '=', ACTIVE_THEME_FOLDER)->first(); $option_exists = $theme->options->where('key', '=', $key)->first(); @@ -26,10 +26,10 @@ function theme_field($type, $key, $title, $content = '', $details = '', $placeho if (!function_exists(theme)){ function theme($key, $default = ''){ - $theme = \Themes\Models\Theme::where('active', '=', 1)->first(); + $theme = \DevDojo\Themes\Models\Theme::where('active', '=', 1)->first(); if(Cookie::get('theme')){ - $theme_cookied = \Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); + $theme_cookied = \DevDojo\Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); if(isset($theme_cookied->id)){ $theme = $theme_cookied; } @@ -53,10 +53,10 @@ function theme_folder($folder_file = ''){ return 'themes/' . THEME_FOLDER . $folder_file; } - $theme = \Themes\Models\Theme::where('active', '=', 1)->first(); + $theme = \DevDojo\Themes\Models\Theme::where('active', '=', 1)->first(); if(Cookie::get('theme')){ - $theme_cookied = \Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); + $theme_cookied = \DevDojo\Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); if(isset($theme_cookied->id)){ $theme = $theme_cookied; } @@ -74,10 +74,10 @@ function theme_folder_url($folder_file = ''){ return url('themes/' . THEME_FOLDER . $folder_file); } - $theme = \Themes\Models\Theme::where('active', '=', 1)->first(); + $theme = \DevDojo\Themes\Models\Theme::where('active', '=', 1)->first(); if(Cookie::get('theme')){ - $theme_cookied = \Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); + $theme_cookied = \DevDojo\Themes\Models\Theme::where('folder', '=', Cookie::get('theme'))->first(); if(isset($theme_cookied->id)){ $theme = $theme_cookied; }