我正在开发一个托管在私人 satis 存储库上的包。当我开始一个新的 Laravel 4 项目时,我需要我的 repo 中的包,并且它被正确安装。安装后我想执行一些迁移和播种,但它不起作用。
根据 Laravel 手册,我可以从包中执行迁移:
php artisan --env=dev migrate --package="kordaat/admin"
但这不起作用,我必须像这样运行:
php artisan --env=dev --path="vendor/kordaat/admin/src/database/migrations"
上述选项有效,但未达到预期。
在我的包中,composer.json 看起来像:
{
"name": "kordaat/admin",
"description": "Admin area created by Kordaat.",
"keywords": ["laravel", "framework"],
"license": "BSD-2-Clause",
"authors": [
{
"name": "Kordaat",
"email": "xxx@xxxx.xxxx"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.1.*",
"illuminate/database": "4.1.*",
"imagine/imagine": "0.6.*@dev",
"cartalyst/sentry": "2.0.*",
"ircmaxell/password-compat": "1.0.*"
},
"autoload": {
"psr-0": {
"Kordaat\\Admin": "src/"
},
"classmap": [
"src/database/migrations",
"src/database/seeds",
"src/controllers",
"src/models"
]
},
"extra": {
"branch-alias": {
"dev-master": "0.1.x-dev"
}
},
"minimum-stability": "dev"
}
种子文件位于“src/database/seeds”内(如 composer.json 中所述)迁移位于“src/database/seeds”内并包含诸如“2013_07_07_194325_admin_users_table.php”等文件。
我进行了作曲家自我更新,
composer self-update
作曲家更新
composer update
和作曲家转储自动加载
composer dump-autoload
但仍然没有找到迁移。
就方面而言,当将迁移文件夹移动到 src/ 文件夹根目录内的数据库文件夹之外时,它会按照我想要的方式工作。除了错误的文件夹位置。
php artisan --env=dev migrate --package="kordaat/admin"
Migration table created successfully.
Migrated: 2013_07_07_194325_admin_users_table
Migrated: 2013_07_07_210428_roles_table
Migrated: 2013_07_07_210933_permission_role_table
Migrated: 2013_07_07_211434_permissions_table
Migrated: 2013_07_17_144758_role_user
Migrated: 2013_07_17_145130_posts
Migrated: 2013_07_17_145413_images
Migrated: 2013_07_17_145631_settings
Migrated: 2013_07_17_150105_companions
Migrated: 2013_07_17_150120_companion_post
这一定是非常愚蠢的事情,但我找不到合适的方法。谁能帮帮我?