How to add foreign key in laravel migration?

|
zms_al 2022-05-01 14:18:23
After that I’ve installed composer & laravel
#Math 2022-05-01 14:24:22
zms_al 2022-05-01 14:15:27
Yes. Worked 😍😍

I’m glad for you πŸ™ƒ

zms_al 2022-05-01 14:31:47
#Math 2022-05-01 14:24:22
I’m glad for you πŸ™ƒ

Thank you ☺️☺️☺️

Thavarajan 2022-05-01 14:56:32
I hope posting questions, without tracking is not possible to resolve
Thavarajan 2022-05-01 14:57:46
There are lot questions not answered even ansered
Ajmal243 2022-05-01 15:15:09
laravel_discuss-119154.jpg
anyone know this error?
Ajmal243 2022-05-01 15:21:17
please help
Ajmal243 2022-05-01 15:33:07
Ajmal243 2022-05-01 15:15:09
anyone know this error?

i want export in excel format

anujrock1 2022-05-01 15:40:37
Ajmal243 2022-05-01 15:33:07
i want export in excel format

It’s very easy

anujrock1 2022-05-01 15:40:48
Follow steps
anujrock1 2022-05-01 15:41:01
Ajmal243 2022-05-01 15:15:09
anyone know this error?

Haven’t face error like this

anujrock1 2022-05-01 15:41:20
Can you show us your export class and from where you are calling it
zms_al 2022-05-01 15:43:41
Ajmal243 2022-05-01 15:15:09
anyone know this error?

Make sure that all classes are defined
Maatwebsiteexcel

Ajmal243 2022-05-01 16:46:12
laravel_discuss-119172.jpg
when installaing maatwebsite/excel it shows like this
Ajmal243 2022-05-01 16:46:36
what is the error?
DesolatorMagno 2022-05-01 16:49:36
It says that it require php 7.0+ and you have PHP 8.0 installed.
Ajmal243 2022-05-01 16:51:03
how to solve this?
Ajmal243 2022-05-01 16:51:13
i have installed php latest version
zms_al 2022-05-01 16:53:06
Ajmal243 2022-05-01 16:51:13
i have installed php latest version

You have to unlike that version then install php 7.1

Ajmal243 2022-05-01 16:53:27
ok
Ajmal243 2022-05-01 16:55:37
how to downgrade the version/
DesolatorMagno 2022-05-01 18:16:53
Ajmal243 2022-05-01 16:51:03
how to solve this?

Check the GitHub for that package and search for a new version.

DesolatorMagno 2022-05-01 18:22:39
You can try the recommendation, use the with all dependency.
parthpabari 2022-05-01 19:07:09
Hire resources with just $5 per hour. Dm for more information. *
Bhavyakumar Panchotiya 2022-05-01 19:13:01
Ajmal243 2022-05-01 16:46:12
when installaing maatwebsite/excel it shows like this

Nothing just go to php.ini file then enable gd extension inside a php.ini file then install again

πŸ‘»πŸ‘» 2022-05-01 19:14:08
How to add foreign key in laravel migration? I have tried a lot but couln’t add. Pls suggest
anujrock1 2022-05-01 19:15:28
Bhavyakumar Panchotiya 2022-05-01 19:13:01
Nothing just go to php.ini file then enable gd extension inside a php.ini file then install again

Are you sure, I think it’s not gd extension error

Bhavyakumar Panchotiya 2022-05-01 19:15:56
πŸ‘»πŸ‘» 2022-05-01 19:14:08
How to add foreign key in laravel migration? I have tried a lot but couln’t add. Pls suggest

$table->foreign(‘user_id’)->references(‘id’)->on(‘users’)->onDelete(‘cascade’)

Bhavyakumar Panchotiya 2022-05-01 19:16:13
anujrock1 2022-05-01 19:15:28
Are you sure, I think it’s not gd extension error

Yes

πŸ‘»πŸ‘» 2022-05-01 19:16:43
Bhavyakumar Panchotiya 2022-05-01 19:15:56
$table->foreign(‘user_id’)->references(‘id’)->on(‘users’)->onDelete(‘cascade’)

Cannot add foreign key constraint error 1215

h_254 2022-05-01 19:17:24
Do you have doctrines/dbal
h_254 2022-05-01 19:18:56
Check your composer.json
#Math 2022-05-01 19:20:53
πŸ‘»πŸ‘» 2022-05-01 19:16:43
Cannot add foreign key constraint error 1215

$table->index(‘user_id’); write this before that

h_254 2022-05-01 19:20:53
Do a composer require doctrine/dbal
#Math 2022-05-01 19:22:05
πŸ‘»πŸ‘» 2022-05-01 19:16:43
Cannot add foreign key constraint error 1215

in down function drop index columb and foreign

|