You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Associate::make()->multiple on a HasMany - BelongsTo relation.
Searching and picking works fine, but as soon as I hit save I get the error. If I removed multiple() it will work fine.
Please keep in mind that I had to put
Expected behavior
Expected to save correctly.
Steps to reproduce
My models are as follows
class Company extends Model
{
use HasFactory;
public function users(): HasMany
{
return $this->hasMany(User::class);
}
}
And in User Model
public function company(): BelongsTo
{
return $this->belongsTo(Company::class);
}
I ran this to produce the relation manager php artisan make:filament-relation-manager CompanyResource users name --associate
And my code in the relation manager table() function is as follows
Hey @classicalguss! We're sorry to hear that you've hit this issue. 💛
However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?
We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.
I think the problem here its that when using multiple()$data['recordId'] will be an array, then the if will not run since $record will be a Collection.
Package
filament/filament
Package Version
v3.2.0
Laravel Version
v10.0.0
Livewire Version
No response
PHP Version
PHP 8.2.17
Problem description
I am trying to use Associate::make()->multiple on a HasMany - BelongsTo relation.
Searching and picking works fine, but as soon as I hit save I get the error. If I removed multiple() it will work fine.
Please keep in mind that I had to put
Expected behavior
Expected to save correctly.
Steps to reproduce
My models are as follows
And in User Model
I ran this to produce the relation manager
php artisan make:filament-relation-manager CompanyResource users name --associate
And my code in the relation manager table() function is as follows
Reproduction repository
https://github.com/classicalguss/curly-disco
Relevant log output
No response
The text was updated successfully, but these errors were encountered: