Skip to content

Instantly share code, notes, and snippets.

@mariapaulinar
Last active August 20, 2016 20:47
Show Gist options
  • Save mariapaulinar/963c18eb8eadaa797c62c827ab221bf4 to your computer and use it in GitHub Desktop.
Save mariapaulinar/963c18eb8eadaa797c62c827ab221bf4 to your computer and use it in GitHub Desktop.
Ejemplo de seeder en Laravel
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('users')->insert([
'name' => str_random(10),
'email' => str_random(10).'@gmail.com',
'password' => bcrypt('secret'),
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment