moved roles to a separate database and added code to make updates

This commit is contained in:
Edward Tirado Jr 2026-04-09 18:30:16 -05:00
parent 985f339725
commit 836ef8f1f6
14 changed files with 317 additions and 21 deletions

View file

@ -2,6 +2,7 @@
namespace Database\Seeders;
use App\Models\Role;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
@ -15,11 +16,27 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// User::factory(10)->create();
if (config('app.env') === 'local') {
User::factory()->create([
'username' => 'testy_mctestface',
'email' => 'test@example.com',
]);
}
User::factory()->create([
'username' => 'testy_mctestface',
'email' => 'test@example.com',
Role::factory()->createMany([
[
'name' => 'ADMIN',
'display_name' => 'Administrator',
'description' => 'Can make any changes to the list including deleting it. Can also invite other users to collaborate on this list.'],
[
'name' => 'EDITOR',
'display_name' => 'Editor',
'description' => 'Can edit list details and can add/remove movies from the list.'],
[
'name' => 'VIEWER',
'display_name' => 'Viewer',
'description' => 'Can view the list, but cannot make any changes.',
],
]);
}
}