Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sparvinnn's avatar

Array transfer via session and fetch information based on it

Hello I'm a novice in Larovel. On one page, I would like to store a dynamic form in the database, and on the next page, I will list these items and, based on that, I have another form to be recorded in the table. But when I do this, I have a error. The my source code and error are as follows. please guide me. Thank you. http://img.mostafa3d.net/di/NCPM/Q2.png http://img.mostafa3d.net/di/JA64/Q3.png http://img.mostafa3d.net/di/WCGR/Q4.png

0 likes
1 reply
sparvinnn's avatar
sparvinnn
OP
Best Answer
Level 1

my problem solved by this source: DB::table('travelers')->insert([ 'faName' => $this->first_name[$i], 'faFamily' => $this->last_name[$i], 'fatherName' => $this->father_name[$i], 'nationalCode' => $this->national_code[$i], 'phone' => $this->phone_number[$i], 'enName' => $this->e_first_name[$i], 'enFamily' => $this->e_last_name[$i], 'email' => $this->email[$i], 'passportNumber' => $this->passport_number[$i], 'expDate' => CustomDateTime::toGreg($this->passport_expire_date[$i]), 'birthDay' => CustomDateTime::toGreg($this->birthday[$i]), 'foreigner' => $foreignerField ]);

        $traveler = DB::table('travelers')->orderBy('id', 'desc')->first();

Thank you

Please or to participate in this conversation.