我遵循本教程: http://fideloper.com/post/41750468389/laravel-4-uber-quick-start-with-auth-guide?utm_source=nettuts&utm_medium=article&utm_content=api& utm_campaign=guest_author
而本教程: http: //laravelbook.com/laravel-database-seeding/
但是,当我尝试运行时php artisan db:seed
,什么也没有发生。
我试试这个:
<?php
// app/database/seeds/groups.php
return array(
'table' => 'groups',
array(
'name' => 'Administrador',
'description' => '<p>Permissão total no sistema</p>',
'created_at' => new DateTime,
'updated_at' => new DateTime
),
array(
'name' => 'Moderadores',
'description' => '<p>Podem apenas postar e moderar comentários</p>',
'created_at' => new DateTime,
'updated_at' => new DateTime
)
);
接下来:php artisan db:seed
。
php artisan db:seed --env=local
Database seeded!
但:
mysql> select * from groups;
Empty set (0.00 sec)