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
Undefined property: App\Models\Issuance::$weeklynetorderid on line 101 in C:\xampp2\htdocs\myapp\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Relations\BelongsTo.php
weeklynetorderid is the foreign key pointing to an id column in another table. The function within the Issuance model is
public function weeklynetorderid()
{
return $this->belongsTo(WeeklyNetorder::class,'weeklynetorderid');
}
I generated WeeklyNetorder model already which is being referred to.
My searches for this error seems to indicate when there is confusion between weeklynetorderid as a function or as a property but it hasn't made a solution clearer to me.
How can I troubleshoot?
The text was updated successfully, but these errors were encountered:
Hi @c-myers1
Its not a laravel issue. Let me explain what was wrong on your above code.
You can't your belongsTo method name same as your foreign key name.
Here your belongsTo method name weeklynetorderid and foreign key weeklynetorderid which is same name.
Rename your belongsTo method name weeklynetorder instead of weeklynetorderid will solve your problem.
With the command
I'm getting the error:
weeklynetorderid is the foreign key pointing to an id column in another table. The function within the Issuance model is
I generated WeeklyNetorder model already which is being referred to.
My searches for this error seems to indicate when there is confusion between weeklynetorderid as a function or as a property but it hasn't made a solution clearer to me.
How can I troubleshoot?
The text was updated successfully, but these errors were encountered: