How can I declare my model relationships and custom attributes properly so that they will be available from auto-completion and have the warning "property accessed via magic method" disappear?
I have nothing above my Model class and I've tried a few examples but none seems to work. i.e @method, @param or I just can't figure out the proper syntax for it.
quantity_remaining is a custom attribute for my Model.
I have it like this ATM:
class MyModel extends Model
{
/**
* @return HasOne
*/
public function packages(): HasOne{
return $this->hasOne(Package::class, 'related_id', 'related_id');
}
public function getQuantityRemainingAttribute(): Int{
//more codes here but not needed for this example
return 1;
}
}

