When trying to access relationships in the frontend, I only get the raw field (eg genus_id) and not the actual relationship objects. In the control panel everything works fine and the entries are linked properly. I've also tried adding 'with' => ['genus'] but that didn't help.
Steps to reproduce
Create models:
class Plant extends Model
{
use HasFactory, HasRunwayResource;
protected $guarded = [];
public $incrementing = false;
public function genus(): BelongsTo
{
return $this->belongsTo(Genus::class);
}
}
class Genus extends Model
{
use HasFactory, HasRunwayResource;
protected $guarded = [];
public $incrementing = false;
public function plants(): HasMany
{
return $this->hasMany(Plant::class);
}
}
2. Add to blueprint:
`plant.yaml`
```yaml
-
handle: genus_id
field:
resource: genus
create: false
type: belongs_to
display: Genus
localizable: false
validate:
- required
Description
When trying to access relationships in the frontend, I only get the raw field (eg
genus_id
) and not the actual relationship objects. In the control panel everything works fine and the entries are linked properly. I've also tried adding'with' => ['genus']
but that didn't help.Steps to reproduce
Create models:
class Genus extends Model { use HasFactory, HasRunwayResource;
}
genus.yaml
Environment
Environment Application Name: Test Laravel Version: 11.23.5 PHP Version: 8.3.10 Composer Version: 2.7.7 Environment: local Debug Mode: ENABLED URL: hello.test Maintenance Mode: OFF Timezone: UTC Locale: en
Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED
Drivers Broadcasting: log Cache: file Database: mysql Logs: stack / single Mail: log Queue: sync Session: file
Livewire Livewire: v3.5.6
Statamic Addons: 1 Sites: 3 (Nederlands, Deutsch, English) Stache Watcher: Enabled Static Caching: Disabled Version: 5.25.0 PRO
Statamic Addons statamic-rad-pack/runway: 7.9.3