Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Class name must be a valid object or a string #88

Open
Tagra opened this issue Apr 16, 2021 · 1 comment
Open

Error: Class name must be a valid object or a string #88

Tagra opened this issue Apr 16, 2021 · 1 comment

Comments

@Tagra
Copy link

Tagra commented Apr 16, 2021

Hello,
When i am using code as below i am getting this error: "Class name must be a valid object or a string"
NovaBelongsToDepend::make('Class', 'VehicleClass', \App\Nova\Vehicle\VehicleClass::class)

But with default BelongsTo
BelongsTo::make('Class', 'VehicleClass', \App\Nova\Vehicle\VehicleClass::class)

It works just fine, what can cause a problem ?

@Tagra
Copy link
Author

Tagra commented Apr 20, 2021

Not sure what is the problem but it works perfect when i uncomment
$this->value = $this->formatDisplayValue($value);

$value = $resource->{$this->attribute}()->withoutGlobalScopes()->first();
if ($value) {
$this->valueKey = $value->getKey();
//$this->value = $this->formatDisplayValue($value);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant