Data exist in attributes table?

|
Behzodjohn 2019-08-20 16:03:32
laravel_discuss-11258.jpg

Behzodjohn 2019-08-20 16:03:41
laravel_discuss-11259.jpg

Behzodjohn 2019-08-20 16:03:55
laravel_discuss-11260.jpg

Behzodjohn 2019-08-20 16:04:45
I think everything is correct,but while creating new attributes can’t add value to product_id
Behzodjohn 2019-08-20 16:06:08
so?
Behzodjohn 2019-08-20 16:06:29
How?
Behzodjohn 2019-08-20 16:06:54
through relationship?
Behzodjohn 2019-08-20 16:07:06
you mean with input
Behzodjohn 2019-08-20 16:08:34
laravel_discuss-11277.jpg
like that?
Behzodjohn 2019-08-20 16:08:48
yes you are right
Behzodjohn 2019-08-20 16:09:37
So,what do you think?
Behzodjohn 2019-08-20 16:10:18
I think my relationship isn’t working in Product model
Behzodjohn 2019-08-20 16:11:53
the same error
Behzodjohn 2019-08-20 16:13:40
public function attributes()
{
return $this->hasMany(Attribute::class,’product_id’,’id’);
}
Behzodjohn 2019-08-20 16:13:48
Behzodjohn 2019-08-20 16:13:40
public function attributes()
{
return $this->hasMany(Attribute::class,’product_id’,’id’);
}

You mean that?

Behzodjohn 2019-08-20 16:14:48
ok!
Behzodjohn 2019-08-20 16:15:38
laravel_discuss-11296.jpg
Here is
RdotDev 2019-08-20 16:17:33
I think attributes is built in name. Please use different name in relation and try
Behzodjohn 2019-08-20 16:17:56
laravel_discuss-11304.jpg

Behzodjohn 2019-08-20 16:18:07
Behzodjohn 2019-08-20 16:17:56

Here is

Behzodjohn 2019-08-20 16:18:41
I tried with that
Behzodjohn 2019-08-20 16:19:47
Yes when I tried I had removed first line I mean
RdotDev 2019-08-20 16:19:53
Behzodjohn 2019-08-20 16:18:07
Here is

Show me the product model . Data exist in attributes table?

Behzodjohn 2019-08-20 16:20:18
RdotDev 2019-08-20 16:19:53
Show me the product model . Data exist in attributes table?

laravel_discuss-11314.jpg

Behzodjohn 2019-08-20 16:20:24
ok!
Behzodjohn 2019-08-20 16:21:56
laravel_discuss-11318.jpg
The result is
Behzodjohn 2019-08-20 16:22:01
No change
Behzodjohn 2019-08-20 16:22:25
yeah I think it is incorrect
Behzodjohn 2019-08-20 16:23:00
5.8
Behzodjohn 2019-08-20 16:23:27
So?
Behzodjohn 2019-08-20 16:24:42
laravel_discuss-11329.jpg
empty again
Behzodjohn 2019-08-20 16:24:55
Yeah I tried with that
Behzodjohn 2019-08-20 16:25:42
Yes,of course
Behzodjohn 2019-08-20 16:26:16
ok
Behzodjohn 2019-08-20 16:26:54
laravel_discuss-11339.jpg
You mean like that
Behzodjohn 2019-08-20 16:28:38
laravel_discuss-11343.jpg
no change
Behzodjohn 2019-08-20 16:29:03
ok
RdotDev 2019-08-20 16:29:12
Behzodjohn 2019-08-20 16:24:42
empty again

The link doesn’t contain the product id. How you fetching product id

Behzodjohn 2019-08-20 16:29:43
laravel_discuss-11349.jpg

Behzodjohn 2019-08-20 16:31:04
Wow ,How?
Behzodjohn 2019-08-20 16:32:13
yeah you are right
Behzodjohn 2019-08-20 16:32:41
So I shoud change attributes to attr enough?
Behzodjohn 2019-08-20 16:33:52
What do you mean?
Behzodjohn 2019-08-20 16:35:22
Sorry,Which url? Could you explain a bit more?
Behzodjohn 2019-08-20 16:36:51
O yeah understandable but
Behzodjohn 2019-08-20 16:37:02
where on my code
Behzodjohn 2019-08-20 16:37:09
in blade
Behzodjohn 2019-08-20 16:39:14
Sorry,I know but I don’t understand what you mean
Behzodjohn 2019-08-20 16:40:23
laravel_discuss-11378.jpg
that?
RdotDev 2019-08-20 16:41:02
Route file
‘**attributes/{id}’

View file
route(‘**attributes**’,$product->id)

|