Open lvismer opened 9 years ago
Does project_no_type
work? or projectNoType().get()
?
The following works,
{{ project.projectNoType().first().projectNoType }}
So for relationship access to work one must use the association relationship?
As far as I'm aware this works in v0.9.0, assuming fixed in https://github.com/rcrowe/TwigBridge/commit/8ad1b509c966b286f923ac5087fd8bca1f539ebe - consider closing?
Test case: Ticket model is provided without loading the user relation (lazy loading)
Twig
{{ ticket.user.formatted_name }}
Classes
class Ticket extends Model
{
public function user()
{
return $this->belongsTo('App\Models\User', 'user_id');
}
}
class User extends Model
{
public function getFormattedNameAttribute()
{
return '...';
}
}
Hi
Was wondering if the following should work with v0.6.1. It is basically accessing a belongsTo relationship on an Eloquent model.
Inside the Project model I have
Then inside the view I try to access the member on the relationship
{{ project.projectNoType.name }}
I am getting the following exception:
Call to undefined method Illuminate\Database\Query\Builder::projectNoType()
Thanks