Laravel Foreign Keys: How to Deal with Errors

preview_player
Показать описание
There are a lot of sub-topics in this video. Why do you need foreign keys? What happens if you don't create them? How to override default errors? Check for child records on the front-end and the back-end? Use if-else or try-catch? Let's dive in.

Related article:

- - - - -
Support the channel by checking out our products:
Рекомендации по теме
Комментарии
Автор

The amount of knowledge you provided me for my work and studies is priceless. Thanks a lot!

santysasa
Автор

Man I love your videos, so glad I've found your channel just now 👍👍👍

ricko
Автор

It was for me a gap filling video. Thanks again.

GergelyCsermely
Автор

Very informative. Keep up your great work!

pierdocks
Автор

thanks sir. Greetings From Java Island

Admirul
Автор

Thank you sir. It helps me a lot ❤️ i had an issue of this error.

Now its fine now ❤️❤️

wardy
Автор

awesome video

this method is working properly, but me personally will take Soft Delete way to keep the user in DB for history purpose instead of disable the delete

aculz
Автор

Nice one 👍
But i prefer to soft delete functionality, if it's a master data...

SandeepBaraskarWebDeveloper
Автор

Hi, good video! I noticed that you use a mac for programming. Is it a version with m1 chip? What tools do you use to program locally in Laravel? Thank you!

matteored
Автор

Great one, thanks for this beauty

How do you you return this error, when dealing with API?

codewithtee
Автор

it is easy if we have single relation. if there are more relations code will become messy, I have tried using an isDeletable function on the model and checking for all relation counts in that function. Any better approach for this?

HamidAliOfficial
Автор

Nice tips as usual. How do you add something like "updated_by" foreign key?
Example: posts (table)
id
body
user_id (Foreign key related to user)
update_by (Another foreign key related to user)

ezichiebere
Автор

I fill tables from an api and I've created foreigns to parent and grandparent but it gave me soo many errors on the parent relation that I just had to remove that relation.
These foreign key constraints can be a huge headache sometimes.

Stoney_Eagle
Автор

Please record video with categories and subcategories with view and dynamic route. Single view with boxes as link to subcategories

marcinmaj
Автор

Thanks, plz make a video on count() error in different php version

robiulalam
Автор

Hi can you pls let me know about the Cors error. I have installed the fruitcake pkg for cors but it does not work. Can you pls help me out

shashi
Автор

The code in the controller doesn't look neat enough, you can use "Policies".

danorex
visit shbcf.ru