【发布时间】:2019-12-31 05:42:18
【问题描述】:
我想在我的资源控制器类声明上方包含一些注释代码,最好在使用php artisan make:controller MyController -resource 生成控制器时添加。即,我想在每个控制器文件的顶部添加路径别名:
/*
Verb URI Action Route Name desc
GET /photos index photos.index Display a listing of the resource.
GET /photos/create create photos.create Show the form for creating a new resource.
POST /photos store photos.store Store a newly created resource in storage.
GET /photos/{photo} show photos.show Display the specified resource.
GET /photos/{photo}/edit edit photos.edit Show the form for editing the specified resource.
PUT/PATCH /photos/{photo} update photos.update Update the specified resource in storage.
DELETE /photos/{photo} destroy photos.destroy Remove the specified resource from storage.
*/
这纯粹是一个方便的示例,但在其他时候,我想将其他内容添加到我使用 artisan 生成的模型和迁移中。这可以做到吗?我需要重新编译工匠二进制文件吗?
【问题讨论】:
-
很酷的问题,这些东西实际上可以通过简单地将它们添加到配置和发布来定制。
标签: php laravel laravel-artisan