Skip to content

Instantly share code, notes, and snippets.

@crynobone
Created November 7, 2013 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crynobone/7355734 to your computer and use it in GitHub Desktop.
Save crynobone/7355734 to your computer and use it in GitHub Desktop.
<?php
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('RemindersTableSeeder');
}
}
<?php
class ExampleTest extends TestCase {
/**
* A basic functional test example.
*
* @return void
*/
public function testBasicExample()
{
$this->seed();
}
/**
* Seed a given database connection.
*
* @param string $class
* @return void
*/
public function seed($class = 'DatabaseSeeder')
{
$artisan = $this->app['artisan'];
$artisan->call('db:seed', array('--class' => $class));
}
}
<?php
class RemindersTableSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('password_reminders')->insert([
'email' => 'crynobone@gmail.com',
'token' => md5('foo'),
'created_at' => Carbon\Carbon::now(),
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment