lanin/laravel-setup-wizard
Composer 安装命令:
composer require lanin/laravel-setup-wizard
包简介
Provide your Laravel project with handy setup wizard
README 文档
README
Provide your Laravel project with handy setup wizard.
Guide your customer through all steps he need to perform for a proper setup of your project.
Installation
PHP 5.5.9+ or HHVM 3.3+, Composer and Laravel 5.1+ are required.
To get the latest version of Laravel-Setup-Wizard, simply install it via composer.
$ composer require "lanin/laravel-setup-wizard:0.1.*"
Once Laravel-Setup-Wizard is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.
Lanin\Laravel\SetupWizard\SetupWizardServiceProvider::class,
Usage
After installation project will receive the new Artisan command:
$ php artisan app:setup
This command gives your customers the easy wizard for initial setup of the your project. By default it has 6 steps:
- Set new
.envfile from your.env.exampleor update existing - Create new DB & user from
.env - Run migrations
- Run seeds
- Create first user
- Optimize code
Also they can run steps manually by adding it's alias as an argument:
$ php artisan app:setup migrate seed
For additional help use:
$ php artisan help app:setup
Configuration
All defaults are stored in setup.php config file. You can publish it in your app's config folder using artisan command:
$ php artisan vendor:publish --tag=setup
Extending
You can create your own installations steps specifying them in your setup.php config.
First you should create new step class that will extend Lanin\Laravel\SetupWizard\Commands\Steps\AbstractStep.
It has three abstract methods that you have to create:
/** * Return command prompt text. * * @return string */ abstract public function prompt();
This method has to return prompt text that will be shown to the user before step is executed.
/** * Prepare step data. * * @return mixed */ abstract protected function prepare();
This method can be used to collect all needed data for the step to execute. For example ask user for extra data or credentials, etc. All this data should be returned for further execution.
/** * Preview results. * * @param mixed $results * @return void */ abstract public function preview($results);
Preview method used to show user info about what particular commands will be executed. It is used to make user sure that everything will be ok.
/** * Finish step. * * @param mixed $results * @return bool */ abstract public function finish($results);
The last but the most important step is right for the step execution. Should return boolean true if everything was ok and false if there was an error.
After everything is done, add your step to the setup.steps array in your setup.php file where key should be a step's alias and value is a fully resolved class name.
Contributing
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
lanin/laravel-setup-wizard 适用场景与选型建议
lanin/laravel-setup-wizard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 12, 最近一次更新时间为 2015 年 11 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「installer」 「wizard」 「laravel」 「setup」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lanin/laravel-setup-wizard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lanin/laravel-setup-wizard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lanin/laravel-setup-wizard 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Provides methods to create, validate and render HTML forms in PHP.
Site generator / tree model duplicator used to generate mini-website or duplicate tree model
Installs Aura packages to the Aura system "package" directory.
Install WordPress must-use plugins with Composer
Arikam CMS installers
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-29