What error you are facing?

|
anujrock1 2022-07-27 19:40:26
Amit Sharma 2022-07-27 19:38:24
actually i am confused a bit

laravel_discuss-130870.jpg
Write this code outside for loop

At line number 145 I guess

Amit Sharma 2022-07-27 19:40:35
anujrock1 2022-07-27 19:38:19
$user = []

For loop
$user[] = [
Column with dat
]

End for loop

if(DB::table->insert($user) ) return redirect code

it will give me the result with multiple rows entry ?

anujrock1 2022-07-27 19:41:11
Amit Sharma 2022-07-27 19:40:35
it will give me the result with multiple rows entry ?

Sorry didn’t get it

Amit Sharma 2022-07-27 19:43:35
laravel_discuss-130873.jpg
here i am taking assessors as multiple here
Amit Sharma 2022-07-27 19:43:50
ok ?
Amit Sharma 2022-07-27 19:44:31
in controller if count($assessors) > 0
anujrock1 2022-07-27 19:44:55
Amit Sharma 2022-07-27 19:44:31
in controller if count($assessors) > 0

Yes

Amit Sharma 2022-07-27 19:45:05
now let say there are 2 assessors selected
anujrock1 2022-07-27 19:45:34
But when for loop runs at first time it will return response so next record would not be created
Amit Sharma 2022-07-27 19:45:39
i want 2 rows with each assessor
anujrock1 2022-07-27 19:45:54
Amit Sharma 2022-07-27 19:45:05
now let say there are 2 assessors selected

Then according to now code only first would be created

Amit Sharma 2022-07-27 19:46:28
yes
Amit Sharma 2022-07-27 19:47:40
if (count($assessors) > 0) {
// dd(count($assessors));
for ($i = 0; $i < count($assessors); $i++) {
$savedata = [
‘org_id’ => $org_id,
‘app_id’ => $app_id,
‘assessor_id’ => $assessor_id,
‘assessors_id’ => $assessors[$i],
‘from_date’ => $from_date,
‘to_date’ => $to_date,
‘assessment_type’ => $assessment_type,
‘stage’ => $stage,
];
}
DB::table(‘app_assessments’)->insert($savedata);
return redirect(‘adminuser/allotment’)->with(‘success’, ‘Assessor Alloted Successfully!!’);
}
Amit Sharma 2022-07-27 19:47:51
is it ok now ?
anujrock1 2022-07-27 19:48:35
Amit Sharma 2022-07-27 19:20:23
i want to store multiple data if count > 0

Line no. 130 $savedata = []; empty array

Line no. 132 $savedata[] = [ existing code]

Remove line no. 142 to 144 code and place after line no. 145

anujrock1 2022-07-27 19:49:08
anujrock1 2022-07-27 19:48:35
Line no. 130 $savedata = []; empty array

Line no. 132 $savedata[] = [ existing code]

Remove line no. 142 to 144 code and place after line no. 145

Amit let me know if you didn’t understand this

Amit Sharma 2022-07-27 19:52:16
anujrock1 2022-07-27 19:49:08
Amit let me know if you didn’t understand this

yes yes got it !

Amit Sharma 2022-07-27 19:52:30
thank you
anujrock1 2022-07-27 19:54:14
Amit Sharma 2022-07-27 19:52:30
thank you

Code worked?

Amit Sharma 2022-07-27 19:56:50
yes
Amit Sharma 2022-07-27 19:59:11
and is it possible to get id from this table
anujrock1 2022-07-27 20:00:20
Amit Sharma 2022-07-27 19:59:11
and is it possible to get id from this table

I haven’t tried anything like this

I think Them you need to create record one by one and storing there ids in your variable

anujrock1 2022-07-27 20:01:03
Or You need to run one more sql after insert to get ids of that
Amit Sharma 2022-07-27 20:01:19
yes
Amit Sharma 2022-07-27 20:02:10
actually inserted record id is required in another table and some other data at same time
anujrock1 2022-07-27 20:04:59
Amit Sharma 2022-07-27 20:02:10
actually inserted record id is required in another table and some other data at same time

You have two option from my knowledge which I already told you

Amit Sharma 2022-07-27 20:07:35
anujrock1 2022-07-27 20:04:59
You have two option from my knowledge which I already told you

ok i will try these

ailiya678 2022-07-27 21:06:45
Time flies so fast, today is over, did you get the results you wanted?
bisnukundu 2022-07-27 21:17:55
https://www.fiverr.com/share/06YYWv

Bisnukundu: I will design and redesign a responsive wordpress website or blog within 24 hour for $50 on fiverr.comFiverr.com
For only $50, Bisnukundu will design and redesign a responsive wordpress website or blog within 24 hour. | PLEASE DISCUSS WITH ME BEFORE PLACE ORDERHello there, I hope you are doing good! My name is Bisnu kundu,a Senior Web Developer.Why choose me?I have | Fiverr
zey34354 2022-07-27 21:26:14
laravel_discuss-130902.jpg
anyone can help me
zey34354 2022-07-27 21:26:57
I got this error after I deployed the project
N_Ibrokhim 2022-07-27 21:54:42
how can i update data in <select>?
melkie K ,,,,,,,,,, N 2022-07-27 22:50:53
$count_tested = imaging_result::where(‘status’, ‘=’, ‘tested’,’$$’, ‘pod_type’,’=’,’opd 2′)->count();
Abd Lah 2022-07-27 23:06:27
How i can manage roles and permission in rest api , is spatie package useful or there is something easy
Software_devel0per 2022-07-27 23:09:18
Abd Lah 2022-07-27 23:06:27
How i can manage roles and permission in rest api , is spatie package useful or there is something easy

You can use middleware and policy, Gate

Abd Lah 2022-07-27 23:11:08
Software_devel0per 2022-07-27 23:09:18
You can use middleware and policy, Gate

Thanks
I will try it with gate and policy

Richard 2022-07-28 04:06:33
I now believe in stock and Cryptocurrency trading after withdrawing my profit through the help of @Trader_Dinashabani I really appreciate all her effort and support thanks to her. Reach out to her, and start a new life of success with profitability. Tap here
⏬⏬⏬
@Trader_Dinashabani
hatsushiroyuki 2022-07-28 04:07:50
The way you guys promoting crypto are making me hating crypto even more. Disgusting way of advertising.
Richard 2022-07-28 04:09:28
hatsushiroyuki 2022-07-28 04:07:50
The way you guys promoting crypto are making me hating crypto even more. Disgusting way of advertising.

I traded my Cryptocurrency with her platform and got 10x my investment.

Web Developer 2022-07-28 06:51:57
melkie K ,,,,,,,,,, N 2022-07-27 22:50:53
$count_tested = imaging_result::where(‘status’, ‘=’, ‘tested’,’$$’, ‘pod_type’,’=’,’opd 2′)->count();

What error you are facing??

Web Developer 2022-07-28 06:52:08
N_Ibrokhim 2022-07-27 21:54:42
how can i update data in <select>?

Using javascript

Web Developer 2022-07-28 06:52:25
zey34354 2022-07-27 21:26:57
I got this error after I deployed the project

Livewire path is wrong

dharmik4 2022-07-28 08:00:41
how to install cronjob in windows for laravel task scheduling
Web Developer 2022-07-28 08:01:10
In control pannel
Web Developer 2022-07-28 08:01:22
You have task scheduler option
Bearedman 2022-07-28 08:40:22
dharmik4 2022-07-28 08:00:41
how to install cronjob in windows for laravel task scheduling

how this can be done in server

Bearedman 2022-07-28 08:40:36
i too have doubt on this
dharmik4 2022-07-28 08:42:31
Web Developer 2022-07-28 08:01:22
You have task scheduler option

it’s not working

CyberPanther 2022-07-28 09:15:00
You also have schedule option in laravel > eloquent
CyberPanther 2022-07-28 09:17:04
But its only for db related schedule
|