Created
April 30, 2015 09:35
-
-
Save naneri/f2f889f517f2b4c0e83a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CompaniesTableSeeder extends Seeder { | |
public function run() | |
{ | |
DB::table('companies')->delete(); | |
$faker = Faker\Factory::create(); | |
foreach(range(1, 1000) as $index) | |
{ | |
$users = User::orderByRaw("RAND()")->first(); | |
Company::create([ | |
'owner_id' => $user->id, | |
'name' => $faker->company, | |
'created_at' => $faker->dateTime($max = 'now') | |
]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment