min*_*evz 5 php laravel-5 laravel-migrations laravel-5.2
我使用Laravel 5.2并通过运行创建了数据库表
php artisan make:migration create_categories_table --create=categories
Run Code Online (Sandbox Code Playgroud)
和
php artisan make:migration create_posts_table --create=posts
Run Code Online (Sandbox Code Playgroud)
然后我运行php artisan migrate,并在数据库中创建表.但是在我对迁移文件"create_posts_table.php"进行了一些更改并运行之后
php artisan migrate:rollback
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
[Symfony\Component\Debug\Exception\FatalErrorException]
未找到类'CreatePostsTable'PHP
致命错误:在E:\ programfiles\xampp\htdocs\deneme\vendor\laravel\framework\src\Illuminate\Database中找不到类'CreatePostsTable'第336行的\ Migrations\Migrator.php
我试过了composer update,composer dump-autoload但这还没有解决问题.
在运行迁移之前,应运行以下命令以确保已清除缓存:
php artisan clear-compiledphp artisan optimize这将确保您的新迁移类已正确注册。
| 归档时间: |
|
| 查看次数: |
3158 次 |
| 最近记录: |