Files
mytodos/database/seeders/BaseDatabaseSeeder.php
T

32 lines
810 B
PHP
Raw Normal View History

2026-09-17 23:01:26 -07:00
<?php
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Seeder;
class BaseDatabaseSeeder extends Seeder
{
/**
* Seed the application's base data.
*/
public function run(): void
{
2026-10-04 20:34:19 -07:00
$admin = User::updateOrCreate(
2026-09-17 23:01:26 -07:00
['email' => config('admin.email')],
[
'name' => config('admin.name'),
'password' => config('admin.password'),
'is_admin' => true,
],
);
2026-10-04 20:34:19 -07:00
// Grandfather the admin so a fresh install is usable before any Stripe
// price is configured. The organization itself is created by the
// model's created hook.
$admin->currentOrganization()->first()?->forceFill([
'lifetime_access' => true,
])->save();
2026-09-17 23:01:26 -07:00
}
}