<?php

use App\Models\Competition;
use App\Models\Season;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;

class CompetitionsTableSeeder extends Seeder
{
    public function run(): void
    {
        Season::each(function (Season $season): void {
            factory(Competition::class)->create(['season_id' => $season->id]);
        });

        $this->createRoles();
    }

    private function createRoles(): void
    {
        Competition::all()->each(function (Competition $competition) {
            Role::create(['name' => "Competition {$competition->getId()} Admin"]);
        });
    }
}

<?php

use App\Models\Competition;
use App\Models\Season;
use Illuminate\Database\Seeder;

class CompetitionsTableSeeder extends Seeder
{
    public function run(): void
    {
        Season::each(function (Season $season): void {
            factory(Competition::class)->create(['season_id' => $season->id]);
        });
    }
}

--- 
+++ 
@@ -3,6 +3,7 @@
 use App\Models\Competition;
 use App\Models\Season;
 use Illuminate\Database\Seeder;
+use Spatie\Permission\Models\Role;
 
 class CompetitionsTableSeeder extends Seeder
 {
@@ -11,5 +12,14 @@
         Season::each(function (Season $season): void {
             factory(Competition::class)->create(['season_id' => $season->id]);
         });
+
+        $this->createRoles();
+    }
+
+    private function createRoles(): void
+    {
+        Competition::all()->each(function (Competition $competition) {
+            Role::create(['name' => "Competition {$competition->getId()} Admin"]);
+        });
     }
 }
Create Competition Admin roles for each competition seeded
