douzhang8144 2018-05-05 11:54
浏览 28
已采纳

如何在laravel中创建构建更新?

I want to know there is any way by which we can create a installer or some package for laravel application by which user can simple paste file and deployer will ask for db host and other setting and install application.

Also is there anyway by which we deploy a new build in current application and it will have all new updates which may contains updates in previous table. We want to keep data safe and release updates.

  • 写回答

1条回答 默认 最新

  • dpbe81245 2018-05-06 05:56
    关注

    Got help from this answer

    Install

    To create installer for your application, you can Laravel-Installer package.

    This package has following features:

    • Check For Server Requirements.
    • Check For Folders Permissions.
    • Ability to set database information.
      • .env text editor
      • .env form wizard
    • Migrate The Database.
    • Seed The Tables.

    Update

    Updating your database mean needs to migrate your database. You can run your migrate command through your application.

    Run migration command from anywhere

    Artisan::call('migrate');
    

    With using route:

    Route::get('/run-migrations', function () {
        return Artisan::call('migrate', ["--force"=> true ]);
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程