Relationship Does Not Exists
I'm struggling to make two tables connect. Seems straight forward:
And here is the error I'm receiving:
Yes, I can appreciate this is exactly what it means yet I'm not sure how to troubleshoot this any further. I checked for typos and looked through Google for solutions however I can't find a solution as they are in Laravel-specific context and years old - hence my post here. Thanks in advance.
- Create your two tables and migrate them. Make sure your migration in one of the tables is connected to the other:
- Create models for both tables. Fill in the 'protected $fillable' and make sure to create the relationship:
public function alhusers(): HasOne {
return $this->hasOne('ahlusers::class');
} - Create your Filament resource and call it from there:
TextInput::make('users')
->relationship('ahlusers', 'abbr'),And here is the error I'm receiving:
Method Filament\Forms\Components\TextInput::relationship does not exist. Yes, I can appreciate this is exactly what it means yet I'm not sure how to troubleshoot this any further. I checked for typos and looked through Google for solutions however I can't find a solution as they are in Laravel-specific context and years old - hence my post here. Thanks in advance.