Skip to content

Commit

Permalink
Adding latest content to make themes compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea-tcg committed Mar 30, 2020
1 parent 40fce3b commit bf81e20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Models/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ class Theme extends Model
protected $fillable = ['name', 'folder', 'version'];

public function options(){
return $this->hasMany('\Themes\Models\ThemeOptions', 'theme_id');
return $this->hasMany('\DevDojo\Themes\Models\ThemeOptions', 'theme_id');
}
}
6 changes: 3 additions & 3 deletions src/ThemesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,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;
}
Expand Down Expand Up @@ -96,7 +96,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']);
Expand Down

0 comments on commit bf81e20

Please sign in to comment.