Class name must be a valid object or a string #26
Comments
Can you confirm please what’s in your attribute_entity table? That would help troubleshoot this issue.. |
Here you go: (saving in version 0.0.3 works as expected, but in the 0.0.3 branch I am unable to get the data as mentioned in #27 ) |
the same problem to me ! |
I'm also having the same problem |
please turn type to alias ! app('rinvex.attributes.attribute')->create([ Array |
kfja85 thanks for the help, it worked! |
@kfja85 @weusder Sorry for the delay, and yes that make sense now. Docs fixed to reflect the new type aliases at 102b930 @psychonetic I've done few tests again now & everything seems to be working fine. What you need to make sure of is the following:
If all these three tables has the correct info, then you should retrieve the value. If not, then please screenshot or dump the three tables here and I'll try to go through it & see what's wrong.. |
@Omranic That sounds good! Yeah, I show you. Attributes table: Attributes entity table: Attributes Varchar Table: So everything should be fine in my opinion. |
Seems to be fine, and I've reproduced the same data as yours & it worked like a charm. One last thing, if you've cache enabled please disable caching & check again and let me know if that makes any difference. It's good to flush app cache for the sake of troubleshooting.. |
I assume that your $article = \App\Models\Article::with(['size'])->find(1);
dd($article->size); If that's what you're doing and you still get nothing, then I'm not sure it's something related to this package. It's working with or without any other packages without a problem, I replicated the same setup & even same table data and can't reproduce your issue. Make sure there's no other size attribute used by the same model or attached by any other package in someway, otherwise please try to reproduce in a new project and mention the steps on how can we reproduce the issue in order to troubleshoot it. For now I'll close this issue as it's not confirmed as an issue, but feel free to open it again or open a new one for further assistance. |
* release/v0.0.4: (56 commits) Update changelog Drop Laravel 5.5 support Update composer packages Update composer packages Apply fixes from StyleCI Check if attribute_entity database table exists before querying entity attributes Return eloquent collection always from getEntityAttributes method for compatibility Add force option to artisan commands Simplify IoC binding Update minimum required PHP version Add Laravel v5.6 support Sort attributes on retrieval Drop useless model contracts (models already swappable through IoC) Typehint method returns Typehint void method returns Fixed #30 Fix entity custom primary id issue (fix #30, #26) Fix documentation code smaple Remove fillable relation rules Fix entities issue and tweak some features ...
Hello,
if I try to create an entity, I get the following error:
Class name must be a valid object or a string
The error occurs inside Illuminate/Database/Eloquent/Concerns/HasRelationships at:
My code:
//attribute creation
//Article (yes, it uses the attributableTrait)
Any idea?
Laravel version is 5.5 and used attributes version is dev-develop 8bce023.
The text was updated successfully, but these errors were encountered: