本文介绍了如何安全地在Laravel中卸载Voyager?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Laravel更新至5.8.*后,旅行者完全被破坏

After update Laravel to 5.8.* Voyager is completely broken

面包突然坏了,可搜索了

Suddenly BREADS are broken, searchable is

在null上调用成员函数getTranslatedAttribute()

Call to a member function getTranslatedAttribute() on null

每次出现...

我正在考虑彻底完全卸载Voyager.

I am thinking about completely uninstall Voyager for good.

如何卸载它?有什么提示吗?

How do I uninstall it? Any hints, please?

推荐答案

旅行者在Laravel应用程序中纠缠自己,只需这样做

Voyager entangles itself in the Laravel application so simply doing

composer remove tcg/voyager

可能还不够

  • composer.json
  • 删除larapack挂钩存储库
  • remove larapack hooks repository from composer.json
"repositories": {
        "hooks": {
            "type": "composer",
            "url": "https://larapack.io"
        }
    }

还删除项目根目录下的hooks目录

Also delete the hooks directory on the root of your project

  • routes/web.php
  • 删除航行路线
  • remove voyager routes from routes/web.php
Route::group(['prefix' => 'admin'], function () {
    Voyager::routes();
});

  • 从配置中删除软件包信息(如果已添加)
  • 文件:config/app.php注释或删除以下几行.

    File: config/app.phpcomment or delete following lines.

    /*
     * Package Service Providers...
     */
    TCG\Voyager\VoyagerServiceProvider::class,
    

    • 让用户模型扩展Auth\User而不是Voyager的用户
      • Let the user model extends Auth\User instead of Voyager's user
      • 从这里

        class User extends \TCG\Voyager\Models\User
        

        对此

        use Illuminate\Foundation\Auth\User as Authenticatable;
        
        class User extends Authenticatable
        

        • config/voyager.php
        • 删除旅行者配置
        • database/migrations
        • 中删除旅行者的迁移

          • 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
            

            • database/seeds
            • 删除数据库种子

              • 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
                

                • 最后删除public/vendor/tcg文件夹以删除静态资产
                  • And finally remove public/vendor/tcg folder to remove static assets
                  • 这篇关于如何安全地在Laravel中卸载Voyager?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 04:34