Skip to content

Commit

Permalink
fintech-fab#17 Сидинг ролей в базу данных через модель
Browse files Browse the repository at this point in the history
  • Loading branch information
kmarenov committed Sep 2, 2014
1 parent a8a9375 commit cd3ef69
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/database/seeds/RoleTableSeeder.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?php

use FintechFab\Models\Role;

class RoleTableSeeder extends Seeder
{

public function run()
{
$sql = 'insert into ' . DB::getTablePrefix() . 'roles (role, role_name) values (?, ?)';
DB::insert($sql, array('admin', 'Админ'));
DB::insert($sql, array('moderator', 'Модератор'));
DB::insert($sql, array('user', 'Пользователь'));
DB::insert($sql, array('messageSender', 'Отправитель сообщений'));
DB::insert($sql, array('messageSubscriber', 'Подписчик на получение сообщений'));
DB::insert($sql, array('employee', 'Сотрудник'));
}
Role::insert(['role' => 'admin', 'role_name' => 'Админ']);
Role::insert(['role' => 'moderator', 'role_name' => 'Модератор']);
Role::insert(['role' => 'user', 'role_name' => 'Пользователь']);
Role::insert(['role' => 'messageSender', 'role_name' => 'Отправитель сообщений']);
Role::insert(['role' => 'messageSubscriber', 'role_name' => 'Подписчик на получение сообщений']);
Role::insert(['role' => 'employee', 'role_name' => 'Сотрудник']);
}

}

0 comments on commit cd3ef69

Please sign in to comment.