40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Database\Component\Seeders;
|
|
|
|
use App\Component\Models\Right;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class AddStaffRights extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
if (Right::where('code', 'clean')->count() == 0) {
|
|
Right::add('clean', 'Обрезка базы');
|
|
}
|
|
if (Right::where('code', 'marketplace')->count() == 0) {
|
|
Right::add('marketplace', 'Маркетплейс');
|
|
}
|
|
if (Right::where('code', 'update')->count() == 0) {
|
|
Right::add('update', 'Обновления');
|
|
}
|
|
if (Right::where('code', 'roommap')->count() == 0) {
|
|
Right::add('roommap', 'Карта залов');
|
|
}
|
|
if (Right::where('code', 'eorders')->count() == 0) {
|
|
Right::add('eorders', 'Онлайн заказы');
|
|
}
|
|
if (Right::where('code', 'loyalty')->count() == 0) {
|
|
Right::add('loyalty', 'Loyalty');
|
|
}
|
|
if (Right::where('code', 'activitymonitor')->count() == 0) {
|
|
Right::add('activitymonitor', 'Монитор активности');
|
|
}
|
|
}
|
|
}
|