Level 41
You mean like this:
$this->inv->id;
I tried $this->id but it returns nothing with artisan tinker:
class Part extends Model
{
public function inv(): BelongsTo
{
echo "foo\n";
echo $this->id . "\n";
return $this->belongsTo(
Inv::class,
'surv_id',
'surv_id'
);
}
}
Please or to participate in this conversation.