If i use echo then this error will come?

|
nanribet 2022-08-25 14:31:27
laravel_discuss-135165.jpg

nanribet 2022-08-25 14:33:41
laravel_discuss-135167.jpg

nanribet 2022-08-25 14:34:18
My routes are defined
nanribet 2022-08-25 14:34:30
Its hitting my controller too
Tobel_l 2022-08-25 14:35:39
I wanted to fetch all data all data of a form wher name matches something. But when I use
” $form = Form:: where ([‘name’=> ‘current ‘])->first ();
. It only fetch 1 data and ignores the rest. Does anyone know an alternative to get all the matching data
nanribet 2022-08-25 14:36:01
Still not working bro
nanribet 2022-08-25 14:36:42
Tobel_l 2022-08-25 14:35:39
I wanted to fetch all data all data of a form wher name matches something. But when I use
” $form = Form:: where ([‘name’=> ‘current ‘])->first ();
. It only fetch 1 data and ignores the rest. Does anyone know an alternative to get all the matching data

” $form = Form:: where ([‘name’=> ‘current ‘])->get ();

Use this and display using foreach loop

nanribet 2022-08-25 14:42:49
Not working bro
Tobel_l 2022-08-25 14:52:09
nanribet 2022-08-25 14:36:42
” $form = Form:: where ([‘name’=> ‘current ‘])->get ();

Use this and display using foreach loop

thanks my G

Boudouft_Kaoutar 2022-08-25 14:54:03
Tobel_l 2022-08-25 14:35:39
I wanted to fetch all data all data of a form wher name matches something. But when I use
” $form = Form:: where ([‘name’=> ‘current ‘])->first ();
. It only fetch 1 data and ignores the rest. Does anyone know an alternative to get all the matching data

you used first() it gives you just 1 record the first one!

Neophyte_01 2022-08-25 14:55:12
laravel_discuss-135180.jpg
i am getting this error
Vineet Malhotra 2022-08-25 14:55:47
Neophyte_01 2022-08-25 14:55:12
i am getting this error

Do you use echo to print the variables

Neophyte_01 2022-08-25 14:56:05
no
Neophyte_01 2022-08-25 14:56:16
if i use echo then this error will come?
Vineet Malhotra 2022-08-25 14:56:42
Let me know the code
Neophyte_01 2022-08-25 14:56:59
yes please let me check
Neophyte_01 2022-08-25 14:57:15
i am copying code for roles and permission
nanribet 2022-08-25 14:57:23
Yesss bro
Neophyte_01 2022-08-25 14:57:25
from one website
Vineet Malhotra 2022-08-25 14:57:53
Basically these roles and permissions are defined in ur model
Akashdeep Singh 2022-08-25 14:57:57
laravel_discuss-135191.jpg
I am getting this error
nanribet 2022-08-25 14:58:09
Tobel_l 2022-08-25 14:52:09
thanks my G

Welcome man

Neophyte_01 2022-08-25 14:58:22
Vineet Malhotra 2022-08-25 14:57:53
Basically these roles and permissions are defined in ur model

ok let me check

nanribet 2022-08-25 14:58:30
laravel_discuss-135194.jpg

Vineet Malhotra 2022-08-25 14:58:31
Akashdeep Singh 2022-08-25 14:57:57
I am getting this error

Use proper namespace

Vineet Malhotra 2022-08-25 14:59:12
Neophyte_01 2022-08-25 14:58:22
ok let me check

Sure may be u r calling ur function from ur model which accept only array

nanribet 2022-08-25 14:59:55
Wow really ??
Neophyte_01 2022-08-25 15:00:07
Vineet Malhotra 2022-08-25 14:59:12
Sure may be u r calling ur function from ur model which accept only array

two models are missing permission and role

nanribet 2022-08-25 15:00:56
But i actually do have data there

I’m trying to read the data(view data) by its id

Vineet Malhotra 2022-08-25 15:00:58
Neophyte_01 2022-08-25 15:00:07
two models are missing permission and role

U may define the table name or create that model

Neophyte_01 2022-08-25 15:01:50
Vineet Malhotra 2022-08-25 15:00:58
U may define the table name or create that model

yes i am checking in db

Neophyte_01 2022-08-25 15:05:18
Vineet Malhotra 2022-08-25 15:00:58
U may define the table name or create that model

still not working same error

nanribet 2022-08-25 15:06:54
I have data in the db
nanribet 2022-08-25 15:07:13
Its loading into my controller i’ve checked using dd();
nanribet 2022-08-25 15:07:25
but its not passing first/fail
|