this is modified seeder code
$user = User::where('id', 1)->get();
$role = Role::where('id', 1)->get();
echo $role;
$user->assignRole([$role->id]);
this is the output
[{"id":1,"team_id":2,"name":"Admin","guard_name":"web","created_at":"2023-01-10T06:40:56.000000Z","updated_at":"2023-01-10T06:40:56.000000Z"}]
Exception
Property [id] does not exist on this collection instance.
at vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php:969
965▕ */
966▕ public function __get($key)
967▕ {
968▕ if (! in_array($key, static::$proxies)) {
➜ 969▕ throw new Exception("Property [{$key}] does not exist on this collection instance.");
970▕ }
971▕
972▕ return new HigherOrderCollectionProxy($this, $key);
973▕ }
1 database/seeders/CreateAdminUserSeeder.php:32
Illuminate\Support\Collection::__get("id")
+22 vendor frames
24 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
you can see that the id is there on echo but I cant assign the role using its id
this only happed when teams set to trues in config file.
I am missing something or is it a bug?(highly doubt it )