Created
January 19, 2014 01:20
-
-
Save ezynda3/8499153 to your computer and use it in GitHub Desktop.
Database seeder
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 JobsTableSeeder extends Seeder { | |
public function run() | |
{ | |
$faker = Faker\Factory::create(); | |
Job::truncate(); | |
foreach(range(1,30) as $index) | |
{ | |
$cat = ['Design', 'Programming', 'Miscellaneous']; | |
$r = rand(0,2); | |
$job = new Job; | |
$job->job_title = $faker->words(2); | |
$job->category = $cat[$r]; | |
$job->location = $faker->city . ', ' . $faker->stateAbbr; | |
$job->description = $faker->paragraphs(4); | |
$job->instructions = $faker->paragraph; | |
$job->company_name = $faker->company; | |
$job->url = $faker->url; | |
$job->email = $faker->email; | |
$job->save(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment