Last active
August 20, 2016 20:47
-
-
Save mariapaulinar/963c18eb8eadaa797c62c827ab221bf4 to your computer and use it in GitHub Desktop.
Ejemplo de seeder en Laravel
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; | |
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