dsfasdfsda234234 2018-02-05 01:37
浏览 56
已采纳

命令“db:seed”在托管时不起作用

Rather works, but it is not accurate. I created many migrations on the local server and debugged them by

php artisan migrate

and

php artisan migrate:reset.

Everything works, no problem. Next, I created classes to fill the tables in the seeds folder. And, consequently, I tested the script for loading data into the database:

php artisan db:seed.

Here, too, everything works fine, the site after these tests is displayed as before. Next, I upload all these changes to the hosting. I note that up to this point this project was already on hosting, but I imported the database there using MySQL. And there it was also displayed perfectly. And now I wanted to test the migration and filling the initial data on the host server. All this is done, of course, by SSH. And what is surprising

php artisan migrate

and

php artisan migrate:reset

work on the hosting correctly, the tables are deleted and created without errors. And when i try to run

php artisan db:seed

The first class in the list of the run() method of the DatabaseSeeder class does not already see the script and I get this error:

Class UsersTableSeeder does not exist

And all other classes are also out of range.

  • 写回答

1条回答 默认 最新

  • douli1872 2018-02-05 01:41
    关注

    You likely have an old autoload file prior to uploading the new code. Try php artisan cache:clear and composer dumpautoload. If those fail, delete the contents of the bootstrap/cache directory and rerun those two commands.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 nginx中的CORS策略应该如何配置
  • ¥30 信号与系统实验:采样定理分析
  • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao
  • ¥20 Vite 打包的 Vue3 组件库,图标无法显示
  • ¥15 php 同步电商平台多个店铺增量订单和订单状态
  • ¥15 关于logstash转发日志时发生的部分内容丢失问题
  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题