ifox
11/17/2021, 12:21 PM`Sebastlan
11/17/2021, 1:24 PMagnonym
11/17/2021, 1:27 PM`Sebastlan
11/17/2021, 1:29 PMhttps://i.imgur.com/fgk6AaB.png▾
`Sebastlan
11/17/2021, 1:30 PM`Sebastlan
11/17/2021, 1:31 PMpublic function author(){
return $this->BelongsTo(Post::class, 'author_id');
}`Sebastlan
11/17/2021, 1:31 PMprotected $fillable = [ 'author_id' ]`Sebastlan
11/17/2021, 1:32 PMpublic function posts(){
return $this->hasMany(Post::class);
}`Sebastlan
11/17/2021, 1:33 PMhttps://i.imgur.com/linwL42.png▾
`Sebastlan
11/17/2021, 1:34 PMhttps://i.imgur.com/5rcTbn9.png▾
agnonym
11/17/2021, 1:41 PMpublic function author()
{
return $this->belongsTo(User::class, 'id', 'author_id');
}`Sebastlan
11/17/2021, 1:43 PMRayderxx
11/17/2021, 1:44 PM`Sebastlan
11/17/2021, 1:44 PM`Sebastlan
11/17/2021, 1:44 PMreturn $this->BelongsTo(User::class, 'author_id', 'id');agnonym
11/17/2021, 1:45 PMRayderxx
11/17/2021, 1:45 PMRayderxx
11/17/2021, 1:46 PM`Sebastlan
11/17/2021, 1:49 PMagnonym
11/17/2021, 1:50 PM`Sebastlan
11/17/2021, 1:52 PM`Sebastlan
11/17/2021, 1:52 PMRayderxx
11/17/2021, 1:53 PMRayderxx
11/17/2021, 1:54 PMSami
11/17/2021, 3:54 PMindexColumns defined as:
php
'category' => [
'title' => 'Category',
'relationship' => 'category',
'field' => 'title',
],
But it takes 'en' title by default, which I don't want, because we use DE language as the 'base language' and so 'en' title is often not even filledSami
11/17/2021, 3:55 PMSami
11/17/2021, 3:56 PMifox
11/17/2021, 3:56 PMifox
11/17/2021, 3:56 PMSami
11/17/2021, 3:56 PM