创建中间件(app/Http/Middleware 下) php artisan make:middleware Activity 创建队列(数据库)的表迁移(需要执行迁移才生效) php artisan queue:table 创建队列类(app/jobs下): php artisan make:job SendEmail 创建请求类(app/Http/Requests下) php a
php artisan make:console ? 生成一个Artisan命令 php artisan key:generate 设置程序密钥 php artisan make:controller ? 生成一个资源控制类 php artisan make:middleware ? 生成一个中间件 php artisan make:migration ? 生成一个迁移文件 php artisan make:model ? 生成一个Eloquent 模型类 php artisan make:pro...
php artisan module:make-controller Admin/ReplyController Blog 创建控制器 php artisan module:make-request CreatePostRequest Blog 生成指定模块的给定请求 php artisan module:migrate-rollback Blog 执行模块最近一次迁移的回滚 php artisan module:migrate-refresh Blog 执行模块所有回滚后执行所有迁移 php artisan mod...
php artisan module:make-listener NotifyUsersOfANewPost Blog php artisan module:make-listener NotifyUsersOfANewPost Blog--event=PostWasCreated php artisan module:make-listener NotifyUsersOfANewPost Blog--event=PostWasCreated #queued php artisan module:make-request CreatePostRequest Blog php artisan modul...
1php artisan make:request StoreBlogPostThe generated class will be placed in the app/Http/Requests directory. If this directory does not exist, it will be created when you run the make:request command. Let's add a few validation rules to the rules method:1/** 2 * Get the validation ...
今天在laravel8下执行php artisan make:auth报如下错误:Command "make:auth" is not defined. Did ...
1php artisan make:request StoreBlogPostThe generated class will be placed in the app/Http/Requests directory. If this directory does not exist, it will be created when you run the make:request command. Let's add a few validation rules to the rules method:1/** 2 * Get the validation ...
模块:make-provider 为指定模块生成给定的服务Provider名称。 php artisan module:make-provider BlogServiceProvider Blog 模块:make-middleware 为指定模块生成给定的中间件名称。 php artisan module:make-middleware CanReadPostsMiddleware Blog 模块:制作邮件
开始接触 Laravel 这个框架的时候,才发现竟然可以使用命令行去执行一些操作,比如:创建文件,运行一个服务等.出于学习或者不能满足需求的时候,我们就需要自己去写一个 Artisan 命令行。 使用命令行输出 Hello 在项目的根目录下面执行php artisan make:command Hello。该命令的结果会在app\Console下面创建一个Commands的文...
make:auth 生成登录和注册路由、视图等 make:command php artisan make:command Test/Test生成新命令 make:controller 创建一个新的控制器类 make:event 创建一个新事件类 make:job 创建一个新JOb类 make:listener 创建一个listener类 make:mail 创建一个mail类 make:middleware 创建一个中间件类make:migration ...