Any references?

|
Itech_programmer 2021-05-23 19:50:30
when $employee->employee it works but when $employee->employee->date_of_birth it doesnt work
j3w1sh 2021-05-23 19:51:40
Itech_programmer 2021-05-23 19:50:30
when $employee->employee it works but when $employee->employee->date_of_birth it doesnt work

screen the result of

dd($employee->employee)

Itech_programmer 2021-05-23 19:52:33
laravel_discuss-82304.jpg

Itech_programmer 2021-05-23 19:52:49
laravel_discuss-82305.jpg

Dilawar Naseem 2021-05-23 19:54:16
laravel_discuss-82306.jpg

Dilawar Naseem 2021-05-23 19:54:36
laravel_discuss-82307.jpg

Dilawar Naseem 2021-05-23 19:54:56
laravel_discuss-82308.jpg

Dilawar Naseem 2021-05-23 19:55:18
laravel_discuss-82309.jpg

Dilawar Naseem 2021-05-23 19:55:31
Please help me in this error
Dilawar Naseem 2021-05-23 19:55:42
How can I solve it
Dilawar Naseem 2021-05-23 19:55:52
Please help
j3w1sh 2021-05-23 20:01:40
Itech_programmer 2021-05-23 19:52:49

this is not dd($employee->employee) result i guess…

j3w1sh 2021-05-23 20:06:58
Dilawar Naseem 2021-05-23 19:55:18

you’re calling get() twice. Remove the last one

bngnnd27 2021-05-23 20:17:10
Hi, i want to ask if anyone know how to show / display data that has foreignID relate to the image that i click. Any references? or what keyword can i use?
Dilawar Naseem 2021-05-23 20:19:08
j3w1sh 2021-05-23 20:06:58
you’re calling get() twice. Remove the last one

laravel_discuss-82317.jpg

Dilawar Naseem 2021-05-23 20:20:01
j3w1sh 2021-05-23 20:06:58
you’re calling get() twice. Remove the last one

laravel_discuss-82318.jpg

Dilawar Naseem 2021-05-23 20:20:12
Please help
sobirjonovs 2021-05-23 20:22:51
Dilawar Naseem 2021-05-23 19:54:36

DB::table(‘std_fees’)->select(‘*’)->where(‘std_id’, session()->get(‘std_id’))->addSelect(DB::raw(‘SUM(Annount) as annount_sum’))->groupBy(‘std_id’)->get();

try it

YOUCODEWORLD 2021-05-23 20:23:39
Dilawar Naseem 2021-05-23 19:54:36

Hi try Remove sun() and add in select(‘*’, DB::raw(‘SUM(price)’))

sobirjonovs 2021-05-23 20:24:30
sobirjonovs 2021-05-23 20:22:51
DB::table(‘std_fees’)->select(‘*’)->where(‘std_id’, session()->get(‘std_id’))->addSelect(DB::raw(‘SUM(Annount) as annount_sum’))->groupBy(‘std_id’)->get();

try it

oh sorry I saw it as COUNT function )) edited.

YOUCODEWORLD 2021-05-23 20:26:27
bngnnd27 2021-05-23 20:17:10
Hi, i want to ask if anyone know how to show / display data that has foreignID relate to the image that i click. Any references? or what keyword can i use?

If you have a foreign key ID you can use that to get data in a relational way.

DesolatorMagno 2021-05-23 20:26:58
Itech_programmer 2021-05-23 19:50:30
when $employee->employee it works but when $employee->employee->date_of_birth it doesnt work

Of course it works, if you call a object or property and it is null you get null, but if you call a property of a null it will return the error, in that screenshot you can se that not every one have a result

sobirjonovs 2021-05-23 20:27:35
DesolatorMagno 2021-05-23 20:26:58
Of course it works, if you call a object or property and it is null you get null, but if you call a property of a null it will return the error, in that screenshot you can se that not every one have a result

The error had already been fixed

DesolatorMagno 2021-05-23 20:27:59
Good for you.
bngnnd27 2021-05-23 20:28:32
i just need to show data that has same foreign id as the image that i click
YOUCODEWORLD 2021-05-23 20:29:09
bngnnd27 2021-05-23 20:28:32
i just need to show data that has same foreign id as the image that i click

Yes you can

bngnnd27 2021-05-23 20:30:20
YOUCODEWORLD 2021-05-23 20:29:09
Yes you can

any references? for the example code? or what keyword can i search?

YOUCODEWORLD 2021-05-23 20:31:11
bngnnd27 2021-05-23 20:30:20
any references? for the example code? or what keyword can i search?

ORM Relationship

Dilawar Naseem 2021-05-23 20:31:23
sobirjonovs 2021-05-23 20:22:51
DB::table(‘std_fees’)->select(‘*’)->where(‘std_id’, session()->get(‘std_id’))->addSelect(DB::raw(‘SUM(Annount) as annount_sum’))->groupBy(‘std_id’)->get();

try it

laravel_discuss-82331.jpg

DesolatorMagno 2021-05-23 20:31:32
bngnnd27 2021-05-23 20:17:10
Hi, i want to ask if anyone know how to show / display data that has foreignID relate to the image that i click. Any references? or what keyword can i use?

You would need JavaScript to update the data that will be show.

YOUCODEWORLD 2021-05-23 20:32:09
laravel_discuss-82333.jpg

sobirjonovs 2021-05-23 20:32:16
Dilawar Naseem 2021-05-23 20:31:23

add group by before the get, I wrote it by phone))

YOUCODEWORLD 2021-05-23 20:32:21
bngnnd27 2021-05-23 20:30:20
any references? for the example code? or what keyword can i search?

here https://laravel.com/docs/8.x/eloquent-relationships

DesolatorMagno 2021-05-23 20:32:23
You can prefill the info using data atributes or use Ajax to get it.
sobirjonovs 2021-05-23 20:32:40
sobirjonovs 2021-05-23 20:22:51
DB::table(‘std_fees’)->select(‘*’)->where(‘std_id’, session()->get(‘std_id’))->addSelect(DB::raw(‘SUM(Annount) as annount_sum’))->groupBy(‘std_id’)->get();

try it

tryit

|