Пример #1
0
 public function run()
 {
     DB::table('roles')->delete();
     App\Role::create(['name' => 'admin', 'display_name' => 'Administrator', 'description' => 'Administrator is allowed to manage whole software']);
     App\Role::create(['name' => 'master', 'display_name' => 'Master', 'description' => 'Master is allowed to manage master section of software']);
     App\Role::create(['name' => 'master-add', 'display_name' => 'Add', 'description' => 'Add is allowed to manage master section of software']);
     App\Role::create(['name' => 'master-view', 'display_name' => 'View', 'description' => 'View is allowed to manage master section of software']);
     App\Role::create(['name' => 'master-edit', 'display_name' => 'Edit', 'description' => 'Edit is allowed to manage master section of software']);
     App\Role::create(['name' => 'master-delete', 'display_name' => 'Delete', 'description' => 'Delete is allowed to manage master section of software']);
     App\Role::create(['name' => 'transaction', 'display_name' => 'Transaction', 'description' => 'Transaction is allowed to manage transaction section of software']);
     App\Role::create(['name' => 'transaction-add', 'display_name' => 'Add', 'description' => 'Add is allowed to manage transaction section of software']);
     App\Role::create(['name' => 'transaction-view', 'display_name' => 'View', 'description' => 'View is allowed to manage transaction section of software']);
     App\Role::create(['name' => 'transaction-edit', 'display_name' => 'Edit', 'description' => 'Edit is allowed to manage transaction section of software']);
     App\Role::create(['name' => 'transaction-delete', 'display_name' => 'Delete', 'description' => 'Delete is allowed to manage transaction section of software']);
     App\Role::create(['name' => 'bill', 'display_name' => 'Bill', 'description' => 'Bill is allowed to manage bill section of software']);
     App\Role::create(['name' => 'bill-add', 'display_name' => 'Add', 'description' => 'Add is allowed to manage bill section of software']);
     App\Role::create(['name' => 'bill-view', 'display_name' => 'View', 'description' => 'View is allowed to manage bill section of software']);
     App\Role::create(['name' => 'bill-edit', 'display_name' => 'Edit', 'description' => 'Edit is allowed to manage bill section of software']);
     App\Role::create(['name' => 'bill-delete', 'display_name' => 'Delete', 'description' => 'Delete is allowed to manage bill section of software']);
     App\Role::create(['name' => 'fleet', 'display_name' => 'Fleet', 'description' => 'Fleet is allowed to manage fleet section of software']);
     App\Role::create(['name' => 'fleet-add', 'display_name' => 'Add', 'description' => 'Add is allowed to manage fleet section of software']);
     App\Role::create(['name' => 'fleet-view', 'display_name' => 'View', 'description' => 'View is allowed to manage fleet section of software']);
     App\Role::create(['name' => 'fleet-edit', 'display_name' => 'Edit', 'description' => 'Edit is allowed to manage fleet section of software']);
     App\Role::create(['name' => 'fleet-delete', 'display_name' => 'Delete', 'description' => 'Delete is allowed to manage fleet section of software']);
     App\Role::create(['name' => 'accounts', 'display_name' => 'Accounts', 'description' => 'Accounts is allowed to manage accounts section of software']);
     App\Role::create(['name' => 'accounts-add', 'display_name' => 'Add', 'description' => 'Add is allowed to manage accounts section of software']);
     App\Role::create(['name' => 'accounts-view', 'display_name' => 'View', 'description' => 'View is allowed to manage accounts section of software']);
     App\Role::create(['name' => 'accounts-edit', 'display_name' => 'Edit', 'description' => 'Edit is allowed to manage accounts section of software']);
     App\Role::create(['name' => 'accounts-delete', 'display_name' => 'Delete', 'description' => 'Delete is allowed to manage accounts section of software']);
     App\Role::create(['name' => 'reports', 'display_name' => 'Reports', 'description' => 'Reports is allowed to manage reports section of software']);
     App\Role::create(['name' => 'reports-add', 'display_name' => 'Add', 'description' => 'Add is allowed to manage reports section of software']);
     App\Role::create(['name' => 'reports-view', 'display_name' => 'View', 'description' => 'View is allowed to manage reports section of software']);
     App\Role::create(['name' => 'reports-edit', 'display_name' => 'Edit', 'description' => 'Edit is allowed to manage reports section of software']);
     App\Role::create(['name' => 'reports-delete', 'display_name' => 'Delete', 'description' => 'Delete is allowed to manage reports section of software']);
 }
Пример #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $arr = ['Admin', 'Moderator', 'Staff', 'User'];
     foreach ($arr as $role) {
         App\Role::create(['name' => strtolower($role), 'label' => $role, 'description' => 'Edit the description for ' . $role]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // create admin role
     $roleAdmin = App\Role::create(['name' => 'admin', 'label' => 'Administrador del sistema']);
     foreach (App\Permission::all() as $permission) {
         $roleAdmin->grantPermission($permission);
     }
 }
Пример #4
0
 public function run()
 {
     DB::table('roles')->delete();
     App\Role::create(['title' => 'Admin', 'code' => 'admin', 'description' => 'Администратор системы', 'sort' => '0', 'visible' => false]);
     App\Role::create(['title' => 'Оператор', 'code' => 'operator', 'description' => 'Оператор Call центра', 'sort' => '1', 'visible' => true]);
     App\Role::create(['title' => 'Менеджер', 'code' => 'manager', 'description' => 'Менеджер проекта', 'sort' => '2', 'visible' => true]);
     App\Role::create(['title' => 'Заказчик', 'code' => 'client', 'description' => 'Заказчик', 'sort' => '3', 'visible' => true]);
 }
Пример #5
0
 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('roles')->delete();
     $faker = $this->getFaker();
     for ($i = 0; $i < 10; $i++) {
         App\Role::create(['name' => $faker->unique()->word]);
     }
 }
Пример #6
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     // DB::table('users')->delete();
     $user = App\User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('password'), 'remember_token' => str_random(10)]);
     $adminRole = App\Role::create(['name' => 'Admin']);
     $customerRole = App\Role::create(['name' => 'Customer']);
     $user->roles()->attach($adminRole->id);
 }
Пример #7
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $role = new \App\Role();
     $role->create(['name' => 'super', 'description' => 'Overlord super admin']);
     $role->create(['name' => 'user', 'description' => 'Regular User']);
 }
Пример #8
0
 /**
  * Create a new role
  * @method createRole
  * @return [type]     [description]
  */
 public function createRole()
 {
     return App\Role::create(['name' => 'Test Role', 'description' => 'Test Role']);
 }
Пример #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     App\Role::create(['name' => 'Super Admin']);
     App\Role::create(['name' => 'Admin']);
     App\Role::create(['name' => 'User']);
 }