Laravel模块,在单个命令(Artisan)中创建模型,迁移和控制器

发布于 2025-01-31 20:37:25 字数 396 浏览 0 评论 0原文

我正在研究一个模块Laravel项目,我想知道是否可以在单个命令(Artisan)中创建模型,迁移和控制器。

我已经知道此命令:

php artisan make:model Todo -mcr

这仅在默认的Laravel项目中起作用,而不是模块化的项目。

我还阅读了“ nofollow noreferrer”> Modular Artisan Commands Docs ,但是没有提及这个问题。

I'm working on a modules Laravel project, and I wonder if it is possible to create model, migration and controller in single command (artisan).

I'm already aware of this command:

php artisan make:model Todo -mcr

This only works in a default Laravel project not a modular one.

I also read all the commands in modular artisan commands docs, but there is no mention of this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

信仰 2025-02-07 20:37:25

跟随官方文档

use App\Http\Controllers\ArticleController;
 
Route::resource('articles', ArticleController::class);

Following the official documentation :

use App\Http\Controllers\ArticleController;
 
Route::resource('articles', ArticleController::class);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文