Skip to content

Commit

Permalink
perf(databases): 调整数据库填充 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaiyuxin103 committed Jan 24, 2025
1 parent 5feb729 commit 0305705
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Database\Seeders;

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

Expand All @@ -15,13 +14,8 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// User::factory(10)->withPersonalTeam()->create();

User::factory()->withPersonalTeam()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);

$this->call(CategorySeeder::class);
$this->call(AdminSeeder::class);
$this->call(ShieldSeeder::class);
}
}
2 changes: 1 addition & 1 deletion database/seeders/ShieldSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function run(): void
{
app()[PermissionRegistrar::class]->forgetCachedPermissions();

$rolesWithPermissions = '[{"name":"super_admin","guard_name":"web","permissions":["view_role","view_any_role","create_role","update_role","delete_role","delete_any_role"]},{"name":"panel_user","guard_name":"web","permissions":[]}]';
$rolesWithPermissions = '[{"name":"super_admin","guard_name":"admin","permissions":["view_role","view_any_role","create_role","update_role","delete_role","delete_any_role"]},{"name":"panel_user","guard_name":"admin","permissions":[]}]';
$directPermissions = '[]';

static::makeRolesWithPermissions($rolesWithPermissions);
Expand Down

0 comments on commit 0305705

Please sign in to comment.