Created
August 9, 2016 04:08
-
-
Save andidp/e5fbfc80f55289619d398cbbe5a35d93 to your computer and use it in GitHub Desktop.
Questions db 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 | |
use Illuminate\Database\Seeder; | |
class QuestionsTableSeeder extends Seeder | |
{ | |
/** | |
* Run the database seeds. | |
* | |
* @return void | |
*/ | |
public function run() | |
{ | |
DB::table('questions')->delete(); | |
$questions = [ | |
['id' => 1, 'title' => 'How to become a best programmer?', 'body' => 'Lorem ipsum dolor sit amet', 'created_at' => new DateTime, 'updated_at' => new DateTime ], | |
['id' => 2, 'title' => 'How to become a best writter?', 'body' => 'Lorem ipsum dolor sit amet', 'created_at' => new DateTime, 'updated_at' => new DateTime ], | |
['id' => 3, 'title' => 'How to become a best business manager?', 'body' => 'Lorem ipsum dolor sit amet', 'created_at' => new DateTime, 'updated_at' => new DateTime ], | |
['id' => 4, 'title' => 'How to become a best project manager?', 'body' => 'Lorem ipsum dolor sit amet', 'created_at' => new DateTime, 'updated_at' => new DateTime ], | |
['id' => 5, 'title' => 'How to become a best designer?', 'body' => 'Lorem ipsum dolor sit amet','created_at' => new DateTime, 'updated_at' => new DateTime ], | |
]; | |
DB::table('questions')->insert($questions); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment