-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 10.4.1
- Nova Version: 4.22.2
- PHP Version: 8.1.17
- Database Driver & Version: SQLite
- Operating System and Version: Win 11
- Reproduction Repository: https://github.com/sedlatschek/laravel-10-nova-4-issues
Description:
Hi,
I have a model called Deadline, which has two self-referencing relations called postponed and postpones:
class Deadline extends Model
{
use HasFactory;
protected $fillable = [
'exceeds_at',
'postponed_id',
];
protected $casts = [
'exceeds_at' => 'datetime',
];
public function postponed(): BelongsTo
{
return $this->belongsTo(Deadline::class);
}
public function postpones(): HasOne
{
return $this->hasOne(Deadline::class, 'postponed_id');
}
}The nova resource for this model looks like this:
class Deadline extends Resource
{
public static $model = \App\Models\Deadline::class;
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Date::make('exceeds_at'),
BelongsTo::make('Postponed To', 'postponed', Deadline::class)
->readonly(),
HasOne::make('Postponed From', 'postpones', Deadline::class)
->readonly(),
];
}
}I can view the resources without any problems:

But when I click on the edit button, I get endless loading:

The nova-api requests returns HTTP 500 after either running out of memory or hitting the maximum execution time.
The Update.vue then runs into the following error:
Update.vue:165 Uncaught (in promise) TypeError: Cannot destructure property 'data' of '(intermediate value)' as it is undefined.
at Proxy.getFields (Update.vue:165:9)
Detailed steps to reproduce the issue on a fresh Nova installation:
- Clone https://github.com/sedlatschek/laravel-10-nova-4-issues
php aritsan migrate:fresh -seed- Open any
Deadlineresource - Click on the edit button
Thanks for your help
Metadata
Metadata
Assignees
Labels
No labels