Which relationship type do you use for images?

|
Kaushikkt 2022-01-09 18:57:31
Sambit22 2022-01-09 18:32:20
Can you tell me how to upload using store()

$path = $request->file(‘avatar’)->store(‘avatars’);

return $path;

$path will have directory name + filename.

Kaushikkt 2022-01-09 18:58:30
Djuraev_Oybek 2022-01-09 18:29:30
Hello everyone
#question
How to make it so that the user can select several products and change them with one request.

example code please

Can you explain with more details ?

Djuraev_Oybek 2022-01-09 19:26:07
Kaushikkt 2022-01-09 18:58:30
Can you explain with more details ?

I want to implement a request like this:
when the cashier sells multiple items, I want to change the quantity of items sold.

Sonu Singh 2022-01-09 19:29:36
Hello guys looking for laravel, vuejs,Iot freelancing work.
If any dm me.
Kaushikkt 2022-01-09 19:38:09
Djuraev_Oybek 2022-01-09 19:26:07
I want to implement a request like this:
when the cashier sells multiple items, I want to change the quantity of items sold.

You mean update stocks?

Danieldrew 2022-01-09 19:39:51
Siberfx 2022-01-09 18:40:41
Which relationship type do you use for images ?

It depends

Djuraev_Oybek 2022-01-09 19:59:43
Kaushikkt 2022-01-09 19:38:09
You mean update stocks?

Yes

Djuraev_Oybek 2022-01-09 20:00:11
Kaushikkt 2022-01-09 19:38:09
You mean update stocks?

Can you help me with example code

Kaushikkt 2022-01-09 20:05:16
Djuraev_Oybek 2022-01-09 20:00:11
Can you help me with example code

$product_attribute = ProductsAttribute::where([‘product_id’ => $item[‘product_id’], ‘size’ => $item[‘size’]])->first(); if($product_attribute){ $stock = $product_attribute->stock – (int) $request->quantity; $product_attribute->update([‘stock’ => $stock]); }

marcosjoao_btu 2022-01-09 20:12:35
hi folks, i have a problem with undefined variable, here do code and the print
marcosjoao_btu 2022-01-09 20:13:47
laravel_discuss-104419.jpg

marcosjoao_btu 2022-01-09 20:13:48
laravel_discuss-104420.jpg

marcosjoao_btu 2022-01-09 20:14:37
what is wrong, I can’t fido the error
marcosjoao_btu 2022-01-09 20:16:44
it is the index of dashboard, I have a page called Client and works perfectly
Djuraev_Oybek 2022-01-09 20:18:02
Kaushikkt 2022-01-09 20:05:16
$product_attribute = ProductsAttribute::where([‘product_id’ => $item[‘product_id’], ‘size’ => $item[‘size’]])->first(); if($product_attribute){ $stock = $product_attribute->stock – (int) $request->quantity; $product_attribute->update([‘stock’ => $stock]); }

thanks a lot 👍

Danieldrew 2022-01-09 20:18:34
marcosjoao_btu 2022-01-09 20:16:44
it is the index of dashboard, I have a page called Client and works perfectly

Maybe the problem is the cache
Run php artisan view:clear

marcosjoao_btu 2022-01-09 20:19:29
yes I do it an nothig changes
marcosjoao_btu 2022-01-09 20:20:05
route:cache, view:clear, view:cache
marcosjoao_btu 2022-01-09 20:20:44
and the error persists
ntonsite 2022-01-09 20:21:37
marcosjoao_btu 2022-01-09 20:20:44
and the error persists

php artisan cache:clear

Danieldrew 2022-01-09 20:21:47
marcosjoao_btu 2022-01-09 20:19:29
yes I do it an nothig changes

Use compact

marcosjoao_btu 2022-01-09 20:22:33
i will try
Danieldrew 2022-01-09 20:23:59
marcosjoao_btu 2022-01-09 20:22:33
i will try

dd($client) in controller or view

marcosjoao_btu 2022-01-09 20:24:47
return view(‘admin.index’, compact(‘clients’)); The problem is the same
marcosjoao_btu 2022-01-09 20:24:58
Danieldrew 2022-01-09 20:23:59
dd($client) in controller or view

i will do

Danieldrew 2022-01-09 20:25:17
marcosjoao_btu 2022-01-09 20:24:58
i will do

What’s response?

Hamza23177 2022-01-09 20:26:44
marcosjoao_btu 2022-01-09 20:13:47

foreach

marcosjoao_btu 2022-01-09 20:27:03
Danieldrew 2022-01-09 20:25:17
What’s response?

nothing

marcosjoao_btu 2022-01-09 20:27:14
Hamza23177 2022-01-09 20:26:44
foreach

I will try

Ragab101 2022-01-09 20:28:49
Take a screenshot shot of your web.php page
marcosjoao_btu 2022-01-09 20:29:22
Hamza23177 2022-01-09 20:26:44
foreach

same error

marcosjoao_btu 2022-01-09 20:29:33
Ragab101 2022-01-09 20:28:49
Take a screenshot shot of your web.php page

ok

marcosjoao_btu 2022-01-09 20:30:40
laravel_discuss-104441.jpg

Danieldrew 2022-01-09 20:33:08
marcosjoao_btu 2022-01-09 20:27:03
nothing

Ok
The problem is that client table is empty

Ragab101 2022-01-09 20:33:23
laravel_discuss-104444.jpg

|