TenantAtlas/apps/platform/database/seeders/PlatformUserSeeder.php
ahmido 29ad8852ca
Some checks failed
Main Confidence / confidence (push) Failing after 1m1s
merge: platform-dev into dev (#295)
## Summary
- integrate the current `platform-dev` branch into `dev`
- bring the latest platform work from the integration branch into the main development branch
- include the recent findings lifecycle backfill removal slice together with the already accumulated `platform-dev` changes

## Scope
- source branch: `platform-dev`
- target branch: `dev`
- branch role: integration PR, not a single-feature PR

## Validation
- branch state reviewed before PR creation
- `platform-dev` is ahead of `dev` with the expected integration history
- this PR intentionally carries the accumulated `platform-dev` commits into `dev`

## Notes
- this is the correct merge direction for the current workflow, where feature branches land in `platform-dev` first and `platform-dev` is then merged into `dev`
- after merging, `platform-dev` can be recreated fresh from `dev` as usual

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #295
2026-04-28 22:11:20 +00:00

51 lines
1.6 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\PlatformUser;
use App\Models\Tenant;
use App\Models\Workspace;
use App\Support\Auth\PlatformCapabilities;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class PlatformUserSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$workspace = Workspace::query()->firstOrCreate(
['slug' => 'default'],
['name' => 'Default Workspace', 'slug' => 'default'],
);
Tenant::query()->updateOrCreate(
['external_id' => 'platform'],
['name' => 'Platform', 'workspace_id' => (int) $workspace->getKey()],
);
PlatformUser::query()->updateOrCreate(
['email' => 'operator@tenantpilot.io'],
[
'name' => 'Platform Operator',
'password' => Hash::make('password'),
'capabilities' => [
PlatformCapabilities::ACCESS_SYSTEM_PANEL,
PlatformCapabilities::USE_BREAK_GLASS,
PlatformCapabilities::CONSOLE_VIEW,
PlatformCapabilities::DIRECTORY_VIEW,
PlatformCapabilities::OPERATIONS_VIEW,
PlatformCapabilities::OPERATIONS_MANAGE,
PlatformCapabilities::OPS_VIEW,
PlatformCapabilities::RUNBOOKS_VIEW,
PlatformCapabilities::RUNBOOKS_RUN,
PlatformCapabilities::OPS_CONTROLS_MANAGE,
],
'is_active' => true,
],
);
}
}