Open abenerd opened 2 years ago
Similarly, I have the following pivot relation
class Salesarea {
// ...
public function scheduled_homescreen_videos(): MorphToMany
{
return $this->morphToMany(TimeSchedule::class, "schedulable")
->withPivot("id")
->using(SchedulableHomescreenVideo::class)
->as("schedulable");
}
}
class SchedulableHomescreenVideo extends MorphPivot implements HasMedia
{
use InteractsWithMedia;
protected $table = "schedulables";
}
I use it in this way, for example:
$time_schedule->schedulable->addMedia($file)->toMediaCollection();
Laravel idea doesn't know that $time_schedule->schedulable
is an instance of SchedulableHomescreenVideo
here.
Feature Description
Say you have a relationship between two tables like these, when I now find a user via the company or vise versa I would love to be able to autocomplete the pivot values.
Ist it possible to autocomplete the last part, the
->pivot->role
part when generating the helper code for the models?