Closed Chalkin closed 6 years ago
Have you registered an attribute for that entity?
Not sure because I have no idea how or where. What I did is adding the city and facebook attributes to eav_attributs via SQL
INSERT INTO `eav_attributes` (`id`, `name`, `label`, `type`, `entity`, `collection`, `default_value`)
VALUES
(1, 'city', 'City', 'Devio\\Eavquent\\Value\\Data\\Varchar', 'Company', 0, NULL);
Instead of Company
set your model path there App\\Customer
in your case
Okay, right. The type path was wrong and the entity as well. So I changed it to the following but still the same error:
INSERT INTO `eav_attributes` (`id`, `name`, `label`, `type`, `entity`, `collection`, `default_value`) VALUES
(1,'city','City','Devio\\Eavquent\\Value\\Data\\Varchar','App\\Customer',0,NULL),
(2,'facebook','Facebook','Devio\\Eavquent\\Value\\Data\\Varchar','App\\Customer',0,NULL);
Eitherway package is currently under development. Haven't tested with L5.3 yet. I will inform you when do.
okay, gonna try it with a 5.2 again. Will let you know.
Yep, in Laravel 5.2.45 it's working.
Do you have any timeline for the package or planed release? We are planing on using it on a project which will go live in about 2-3 months. We would like to use eavquent if it's released until then.
Meanwhile we can help in testing (by extensivly using it)
So, no timeline? No Changes the last 2 month - are you still developing on the package or is it basically dead?
I am currently developing. It's just a matter of time I cannot update as regularly as I wish 😢
I have tried to get eavquent to work in a newly created Laravel Project (5.3.7) but when i try to retrieve the model object of customer, i get
Call to undefined method Illuminate\Database\Query\Builder::city()
This is the repository: https://bitbucket.org/Klostermeier/eavquent/src
Table values:
eav_values_varchar
INSERT INTO
eav_values_varchar(
id,
content,
attribute_id,
entity_id) VALUES (1,'Madrid',1,1);
customers:
INSERT INTO
customers(
id,
name,
user_id,
created_at,
updated_at) VALUES (1,'Dr. Barton Hane Sr.',1,'2016-09-08 21:54:51','2016-09-08 21:54:51');
eav_attributes:
INSERT INTO
eav_attributes(
id,
name,
label,
type,
entity,
collection,
default_value) VALUES (1,'city','City','App\\Http\\Controllers\\Varchar','App\\Http\\Controllers\\Customer',0,NULL), (2,'facebook','Facebook','App\\Http\\Controllers\\Varchar','App\\Http\\Controllers\\Customer',0,NULL);
I can't find the problem which is causing it.