Seeding
Tachi Kit has three seeders in database/seeders/:
| Seeder | Runs | Creates |
|---|---|---|
DatabaseSeeder |
php artisan db:seed |
Calls the two below |
RolePermissionSeeder |
Always | Every permission, plus the superadmin, admin and user roles with their permissions |
DemoUserSeeder |
Outside production only | Four demo staff accounts and 50 members |
public function run(): void{ $this->call(RolePermissionSeeder::class);
if (app()->isProduction()) { return; }
$this->call(DemoUserSeeder::class);}RolePermissionSeeder
Section titled “RolePermissionSeeder”- Creates one permission per
Permissionenum case. - Creates the system roles.
superadmingets every permission (PermissionEnum::values());admingets the user-management permissions;usergets none. - Is idempotent: it uses
firstOrCreateeverywhere, so running it again never duplicates or fails. Re-run it after adding a permission:
php artisan db:seed --class=RolePermissionSeederIt never removes permissions or revokes them from roles. Do removals in a migration or on the Roles page.
DemoUserSeeder
Section titled “DemoUserSeeder”Seeds only when the users table is empty, so it never touches real data:
| Role | |
|---|---|
superadmin@tachikit.com |
superadmin |
superadmin2@tachikit.com |
superadmin |
administrator@tachikit.com |
admin |
admin@tachikit.com |
admin |
Plus 50 user-role members with random names, created over the last 12 months (for the dashboard chart), about 10% of them inactive. Every password is password.
Production
Section titled “Production”php artisan db:seed --force in production only runs RolePermissionSeeder. Create your first account with tachi:superadmin.
Customizing
Section titled “Customizing”Changing the demo data
Section titled “Changing the demo data”Edit DemoUserSeeder: change the accounts, the member count, or add demo records for your own models. Use the factory states (asAdmin(), asSuperadmin(), asUser(), inactive(), withRole(...)) described in Testing.
Seeding your own reference data
Section titled “Seeding your own reference data”Create a seeder with php artisan make:seeder and add it to DatabaseSeeder. Put it before the production check if the data is needed everywhere (like lookup tables), and inside DemoUserSeeder or after the check if it’s only demo content.