Skip to content

Migrating from v1.x

Sebastien edited this page May 11, 2021 · 11 revisions

Some Breaking Changes have been introduced in version 2.0. If you have installed v1.x then please follow the following steps to upgrade to current version:

1. Updating package to v2.x

  • Edit your composer.json file and change package version to: "igaster/laravel-theme": "^2.0"
  • Update your package but do not run post-update scripts (because artisan will fail):
composer update igaster/laravel-theme --no-scripts
  • Change package declarations at config/app.php (See step #2# below)
  • Now you may execulte php artisan optimize from the command line to complete installation

2. Namespace changed

Package namespace has been changed from igaster\laravelTheme to Igaster\LaravelTheme. On a typical setup there are three locations that should be updated:

  • Update providers array in config\app.php. Change decleration from igaster\laravelTheme\themeServiceProvider::class to Igaster\LaravelTheme\themeServiceProvider::class
  • Update Facades array in config\app.php. Change decleration from 'Theme'=>igaster\laravelTheme\Facades\Theme::class, to 'Theme'=>Igaster\LaravelTheme\Facades\Theme::class,
  • If you are using setTheme middleware then you have to update the declaration at routeMiddleware array in file app\Http\Kernel.php. Change to 'setTheme'=>\Igaster\LaravelTheme\Middleware\setTheme::class,

3. Theme::config() & Theme::configSet

  • Theme::config('key','default') has been renamed to Theme:getSetting('key', 'default')
  • Theme::configSet('key','value') has been renamed to Theme:setSetting('key', 'value')

4. Debug mode:

Debug mode has been deprecated. You can remove the debug setting from config/themes.php file