我使用以下命令在Laravel 5上创建模型:

php artisan make:model Settings

As it shows on the video lessons that as soon as model is created, new migration file also must be created. But, in my situtation, migration is not being created. How can I get the migration generated when model is created?

composer.json:

...
    "require": {
            "php": ">=5.5.9",
            "laravel/framework": "5.1.*"
        },
...

推荐答案

我猜您的L5版本相当旧了,因为他们在创建模型的同时禁止创建migrations.

Try running the ff:

php artisan make:model Settings --migration

Laravel相关问答推荐

URL类图中的循环关系

如何使用 Laravel 进行继承

在Laravel中URL中添加保护ID

为什么使用 created_at 表在迁移错误中创建表?

LARAVEL 从多个表中获取重复的行

spatie 包 laravel-tags 在迁移中没有 down() 函数是有原因的吗

使用正则表达式 laravel 忘记缓存

使用枢轴插入多对多时的Laravel问题

在 laravel 中查询此类数据的最佳做法是什么?

当使用Laravel eloquent查询100000条数据时速度很慢

laravel render() 方法有什么用?

如何在 laravel 5.2 中显示 500 内部服务器错误页面?

使用 Laravel 和 Passport 验证失败时响应状态码 401?

在 Laravel 4 迁移中创建 MYSQL 过程

Laravel 5 与 Postgresql

Laravel 4 - 如何将所有字段的所有验证错误消息作为 JSON struct 返回?

Blade 中的条件扩展

如何在不要求用户登录 Laravel 的情况下验证Electron邮件

Laravel 验证用户名不允许有空格

你如何在 Laravel 5.3 的新通知服务生成的Electron邮件中添加图像?