php artisan db:当我尝试使用它时,Laravel5的种子无效。我的 DatabaseSeeder.php 类如下
<?php
use App\User;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use DB;
class DatabaseSeeder extends Seeder
{
public function run()
{
$this->call('UserTableSeeder');
$this->command->info('User table seeded!');
}
}
class UserTableSeeder extends Seeder
{
public function run()
{
DB::table('users')->delete();
User::create(array(
'name' => 'Rakesh',
'username' => 'Rakesh',
'email' => 'sharmarakesh395@gmail.com',
'password' => Hash::make('mypass'),
));
}
}
我正在尝试运行php artisan db:seed
。但它没有用。谢谢