bohlam / lumen-generator
您缺少一个Lumen代码生成器
0.1.2
2024-04-25 16:12 UTC
Requires
- classpreloader/classpreloader: ^4.0
- illuminate/console: ^11.0
- illuminate/filesystem: ^11.0
- illuminate/support: ^11.0
- psy/psysh: ^0.12
- symfony/var-dumper: ^7.0
Suggests
- anik/form-request: Required to use form request in Lumen.
This package is auto-updated.
Last update: 2024-09-28 05:39:04 UTC
README
您在Lumen项目中是否缺少任何Laravel代码生成器?如果是的话,那么您就来到了正确的位置。
安装
要使用Lumen中的某些生成器命令(就像您在Laravel中做的那样),您需要添加此软件包
composer require flipbox/lumen-generator
配置
在您的bootstrap/app.php
文件中,添加以下内容
$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);
可用命令
key:generate Set the application key
make:cast Create a new custom Eloquent cast class
make:channel Create a new channel class
make:command Create a new Artisan command
make:controller Create a new controller class
make:event Create a new event class
make:exception Create a new custom exception class
make:factory Create a new model factory
make:job Create a new job class
make:listener Create a new event listener class
make:mail Create a new email class
make:middleware Create a new middleware class
make:migration Create a new migration file
make:model Create a new Eloquent model class
make:notification Create a new notification class
make:observer Create a new observer class
make:pipe Create a new pipe class
make:policy Create a new policy class
make:provider Create a new service provider class
make:request Create a new form request class
make:resource Create a new resource
make:rule Create a new rule
make:seeder Create a new seeder class
make: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>");