Im starting with Laravel/Eloquent short ago. Coming from Java/Hibernate, but never mastered.Trying to open new ways. Using Laravel 8, latest version right now. AFAIK, in java hibernate, you can declare id attribute in Model, link it via Hibernate annotations to DB builder, and, when you deploy the app it creates a bunch of tables and restrictions such as PK, FK, UNIQUE, etc (keeping it simple stupid).
But not in Laravel or so i think. I get this error
from User Model created by artisan, but slightly modified with some random attributes, but no static function id() inside
This, the Factory in trouble, I guess, in $vend->id, and $comp->id. Sellers and buyers extends User. All Users can be both sellers and buyers, but can´t buy to themselves
What am I loosing? How to statically call an attribute of instantiated object? shoul I implement a static function like return self::id
? but no id inside just in the tables seeded!!! Then should i put inside my Models an id attribute?
Sorry if it sounds dumb, so I am, and newbie too. Thanks in advance
id()
method in any of those factories. – Donkarnashid()
on User – Donkarnash