moved roles to a separate database and added code to make updates
This commit is contained in:
parent
985f339725
commit
836ef8f1f6
14 changed files with 317 additions and 21 deletions
|
|
@ -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.',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue