We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--level
In laravel/framework#45894 a new PendingHasThroughRelationship was introduced to allow for easier through-relation building.
PendingHasThroughRelationship
However, when using these relations in my application, I was faced with the following error:
------ ------------------------------------------------------------------------------------------------------- Line app\Models\BaseModel.php ------ ------------------------------------------------------------------------------------------------------- x Parameter #1 $callback of method Illuminate\Database\Eloquent\PendingHasThroughRelationship::has() expects (callable(Illuminate\Database\Eloquent\Model): Illuminate\Database\Eloquent\Relations\HasMany|Illuminate\Database\Eloquent\Relations\HasOne)|string, Closure(App\Models\ThroughModel): Illuminate\Database\Eloquent\Relations\HasMany<App\Models\RelatedModel> given. ------ -------------------------------------------------------------------------------------------------------
See also the PR mentioned above
class Project extends Model { public function deployments() { return $this->through($this->environments()) ->has(fn (Environment $env) => $env->deployments()); } public function environments() { return $this->hasMany(Environment::class); } } class Environment extends Model { public function deployments() { return $this->hasMany(Deployment::class); } } class Deployment extends Model { // }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
--level
used: 6Description
In laravel/framework#45894 a new
PendingHasThroughRelationship
was introduced to allow for easier through-relation building.However, when using these relations in my application, I was faced with the following error:
Laravel code where the issue was found
See also the PR mentioned above
The text was updated successfully, but these errors were encountered: