4

After update Laravel to 5.8.* Voyager is completely broken

Suddenly BREADS are broken, searchable is

Undefined variable

Call to a member function getTranslatedAttribute() on null

appears every time...

I am thinking about completely uninstall Voyager for good.

How do I uninstall it? Any hints, please?

Community
  • 1
  • 1
Marcello Pato
  • 500
  • 6
  • 21

2 Answers2

20

Voyager entangles itself in the Laravel application so simply doing

composer remove tcg/voyager

may not be enough

  • remove larapack hooks repository from composer.json
"repositories": {
        "hooks": {
            "type": "composer",
            "url": "https://larapack.io"
        }
    }

Also delete the hooks directory on the root of your project

  • remove voyager routes from routes/web.php
Route::group(['prefix' => 'admin'], function () {
    Voyager::routes();
});
  • Remove Package information from config (if added)

File: config/app.php comment or delete following lines.

/*
 * Package Service Providers...
 */
TCG\Voyager\VoyagerServiceProvider::class,
  • Let the user model extends Auth\User instead of Voyager's user

From this

class User extends \TCG\Voyager\Models\User

To this

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
  • delete voyager config from config/voyager.php
  • remove voyager migrations from database/migrations
2016_01_01_000000_create_pages_table.php
2016_01_01_000000_create_posts_table.php
2016_02_15_204651_create_categories_table.php
2017_04_11_000000_alter_post_nullable_fields_table.php
  • remove database seeders from database/seeds
CategoriesTableSeeder.php
DataRowsTableSeeder.php
DataTypesTableSeeder.php
MenuItemsTableSeeder.php
MenusTableSeeder.php
PagesTableSeeder.php
PermissionRoleTableSeeder.php
PermissionsTableSeeder.php
PostsTableSeeder.php
RolesTableSeeder.php
SettingsTableSeeder.php
TranslationsTableSeeder.php
UsersTableSeeder.php
VoyagerDatabaseSeeder.php
VoyagerDummyDatabaseSeeder.php
  • And finally remove public/vendor/tcg folder to remove static assets
Imran Qamer
  • 2,253
  • 3
  • 29
  • 52
Salim Djerbouh
  • 10,719
  • 6
  • 29
  • 61
  • I think I found the bug. This error runs when setting server-side pagination. – Marcello Pato Sep 26 '19 at 21:39
  • Yep that messes things up. The listings won't work anymore with large numbers of users. If you still want to get rid of Voyager entirely don't forget to delete the corresponding database tables as well. – Owen Jan 21 '20 at 08:44
  • didnt need to remove Intervention\Image\ImageServiceProvider???? – saber tabatabaee yazdi Feb 28 '20 at 13:56
  • That's not necessarily related to Voyager, it's a different package for image manipulation – Salim Djerbouh Feb 28 '20 at 20:59
  • 1
    For the migrations, if you already ran them, it's probably best to just write new ones with "dropIfExists" to remove those tables. Simply deleting the files won't be enough. – Eskay Amadeus Jan 16 '22 at 19:31
2

To be honest never upgrade an existing project without preparation.

  1. Back-up your code (GIT is great)
  2. Back-up your database to reverse, if something gets broken.
  3. Repeat this also when upgrading a Drupal or WordPress website

To uninstall you need:

composer remove tcg/voyager

Also remove the routes from your routes/web.php