Skip to content

Commit

Permalink
Copy DatabaseSeeder when installing with team support (#1461)
Browse files Browse the repository at this point in the history
* Copy DatabaseSeeder when installing with team support

To ensureApplicationIsTeamCompatible, the seeded test user must be created withPersonalTeam.

* Update DatabaseSeeder.php

---------

Co-authored-by: Dries Vints <[email protected]>
  • Loading branch information
miclaus and driesvints authored Mar 29, 2024
1 parent a57f6e9 commit 152c89b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Database\Seeders;

use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->withPersonalTeam()->create();

User::factory()->withPersonalTeam()->create([
'name' => 'Test User',
'email' => '[email protected]',
]);
}
}
3 changes: 3 additions & 0 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ protected function ensureApplicationIsTeamCompatible()
// Factories...
copy(__DIR__.'/../../database/factories/UserFactory.php', base_path('database/factories/UserFactory.php'));
copy(__DIR__.'/../../database/factories/TeamFactory.php', base_path('database/factories/TeamFactory.php'));

// Seeders...
copy(__DIR__.'/../../database/seeders/DatabaseSeeder.php', base_path('database/seeders/DatabaseSeeder.php'));
}

/**
Expand Down

0 comments on commit 152c89b

Please sign in to comment.