如何在laravel 5中使用参数创建命令(使用phpmd作为php artisan phpmd)? [英] how to create command with argument in laravel 5(use phpmd as php artisan phpmd )?

查看:48
本文介绍了如何在laravel 5中使用参数创建命令(使用phpmd作为php artisan phpmd)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个应用程序,其中我想在项目中本地使用linter.

I have develop a app in which I want to use linter locally from project.

php artisan phpmd <file> <ruleset>

我看过vedios,但是我有laravel 4但我想要laravel 5有适当的步骤.您能告诉我还是参考任何链接?

I have seen vedios but I got of laravel 4 but I want laravel 5 with proper steps.Can you please tell me or refer any link?

推荐答案

只需遵循文档并使用$signature变量:

protected $signature = 'email:send {user} {from}';

在这里,userfrom是参数.

然后您可以使用以下参数:

Then you can use these arguments:

echo $this->argument('user');

这篇关于如何在laravel 5中使用参数创建命令(使用phpmd作为php artisan phpmd)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆