php class UserTableSeeder extends Seeder public function run DB table

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
class UserTableSeeder extends Seeder {
public function run()
{
DB::table('users')->truncate();
DB::table('groups')->truncate();
DB::table('users_groups')->truncate();
Sentry::createGroup(array(
'name' => 'admin',
));
Sentry::createGroup(array(
'name' => 'team_member',
));
$admin = Sentry::createUser(array(
'email' => 'Jon.c.crowe@gmail.com',
'password' => 'testpass',
'activated' => true,
));
$adminGroup = Sentry::findGroupByName('admin');
$admin->addGroup($adminGroup);
}
}