yaangvu / lumen-generator
你缺失的Lumen生成器
v2.0.3
2022-07-11 10:11 UTC
Requires
- classpreloader/classpreloader: ^4.2
- illuminate/console: ^7|^8|^9
- illuminate/filesystem: ^7|^8|^9
- illuminate/support: ^7|^8|^9
- psy/psysh: ^0.11
- symfony/var-dumper: ^4.2|^4.3|^5.0|^5.1|^5.2|^6.0
Suggests
- anik/form-request: Required to use form request in Lumen.
README
你在Lumen项目中缺少任何Laravel代码生成器吗?如果是的话,那你就在正确的位置。
安装
要使用Lumen(就像你在Laravel中一样)中的某些生成器命令,你需要添加这个包
composer require yaangvu/lumen-generator
配置
在你的bootstrap/app.php
文件中,添加
$app->register(YaangVu\LumenGeneratorServiceProvider::class);
可用命令
key:generate Set the application key
yaang:cast Create a new custom Eloquent cast class
yaang:channel Create a new channel class
yaang:command Create a new Artisan command
yaang:controller Create a new controller class
yaang:event Create a new event class
yaang:exception Create a new custom exception class
yaang:factory Create a new model factory
yaang:job Create a new job class
yaang:listener Create a new event listener class
yaang:mail Create a new email class
yaang:middleware Create a new middleware class
yaang:migration Create a new migration file
yaang:model Create a new Eloquent model class
yaang:notification Create a new notification class
yaang:pipe Create a new pipe class
yaang:policy Create a new policy class
yaang:provider Create a new service provider class
yaang:request Create a new form request class
yaang:resource Create a new resource
yaang:rule Create a new rule
yaang:seeder Create a new seeder class
yaang:test Create a new test class
notifications:table Create a migration for the notifications table
schema:dump Dump the given database schema
其他有用命令
clear-compiled Remove the compiled class file
serve Serve the application on the PHP development server
tinker Interact with your application
optimize Optimize the framework for better performance
route:list Display all registered routes.
注意
route:list
命令已通过appzcoder/lumen-route-list包添加。
Tinker include
参数用法
php artisan tinker path/to/tinker/script.php
script.php示例
$environment = app()->environment();
$output = new Symfony\Component\Console\Output\ConsoleOutput();
$output->writeln("<info>Hello the app environment is `{$environment}`</info>");
$output->writeln("<comment>Did something</comment>");
$output->writeln("<error>Did something bad</error>");