Closed Pok09 closed 10 months ago
The same error on a fresh installation of laravel
See previous exception for cause of failure
In your logs, there will be the previous exception which is the cause of the failure. What does that say?
Closing this - you need to refer to the previous exception for the cause of the failure. That'll be in your logs.
FYI the next version of this package - v3.2 - will remove the catching of the original exception and just let that bubble up, rather than the cause being in the previous exception.
@lindyhopchris I have the same problem in the following case and with eager loading:
two fields with the same type:
HasOne::make('metric')->type('inventory-metrics'), HasOne::make('metric-service', 'metricService')->type('inventory-metrics'),
in model:
public function metric(): HasOne { return $this->hasOne(Metric::class, 'id', 'metric_id'); } public function metricService(): HasOne { return $this->hasOne(Metric::class, 'id', 'metric_service_id'); }
in AppServiceProvider
I have Model::preventLazyLoading()
I include both relations in the query!
include=metric,metric-service
and throw an exception: Attempted to lazy load [metric] on model
@veneliniliev are you using our controller action, or have you written your own controller action?
@veneliniliev are you using our controller action, or have you written your own controller action?
i use LaravelJsonApi\Laravel\Http\Controllers\JsonApiController
And the error is originating from something that is returned from that controller by the package's code, and not your own?
If so, can you create a separate issue as it is unrelated to this issue.
I want to use it with orchid.software
I configured everything correctly, but can't get it to work properly
`Unable to encode compound document. See previous exception for cause of