Skip to content

Instantly share code, notes, and snippets.

@kyledoesdev
Created December 20, 2024 16:14
Show Gist options
  • Select an option

  • Save kyledoesdev/73c736046f23586fe1dd269c59c91f51 to your computer and use it in GitHub Desktop.

Select an option

Save kyledoesdev/73c736046f23586fe1dd269c59c91f51 to your computer and use it in GitHub Desktop.
hasManyThrough.php
public function relationship(): HasManyThrough
{
return $this->hasManyThrough(
// The final model
// The intermediary model
// Foreign key on the intermediary table
// Foreign key on the final table
// Local key on the current table
// Local key on the intermediary table
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment