Laravel 5.8 Tutorial From Scratch - e14 - Eloquent BelongsTo & HasMany Relationships

preview_player
Показать описание
In this episode, we are starting out by reviewing what we have learned so far to create a company model and migration. For new content, we are tackling connecting the company to a customer using the belongsTo and hasMany eloquent relationship.

Resources
Course Source Code

About This Course

Ready to get started on your path to Laravel Artisan? In this series, we are breaking down all of the basics of Laravel to get you comfortable using the world's most popular PHP framework. Let's get started!
Рекомендации по теме
Комментарии
Автор

Saved me from having a major headache. I totally forgot about inserting the foreign key's name into the model's $fillable array, and as one would expect, the inverse One-to-many relationship was returning null. I finally found the answer in your excellent tutorial. I owe you big time!

trancecoremedia
Автор

Although I dont understand completely your lessons, 'cause I'm Vietnamese and my English isn't good, but It's really useful for me. Everyday, I study by my self, also these lessons are wonderful. I wish, i have a teacher like U, thank U so much!!!

phongvexuantruong
Автор

Very good, you're helping me in Brazil. Thank you!

andersondeoliveiraventurin
Автор

Thanks, helpful and easy to understand.

Автор

Very detailed explanations. Very hard to find this kind of video tutorials around.

asrorbekmannonov
Автор

Thanks, your explanation is very good, i like it. keep making good content bro

arbzlgk
Автор

Great tutorial. Well explained all the things. Thank you.

maheshlowe
Автор

Hey Programmers! It's very very best tutorial for learning Laravel

XushnudbekXudoynazarov
Автор

Best tutorial out there.
Hey i am getting customers and company relation
$customers=Customer::first()
$customers->company
with this in tinker but null in vice versa $c=Company::first()
$c->customers

randomvideosshideos
Автор

ThankYou! This helped me a lot. 😍 Awesome presentation.

alankanavenger
Автор

Very simple and clear tutorial.Thank u bro

LOMBOist
Автор

Thank you for sharing your knowledge with us. Greetings from Colombia

HidegardRaven
Автор

Thank you very much this really helped me with my project .keep up the good work 👍❤

elyasmoshirpanahi
Автор

WOW tutorial sir !!! extremely good clear and precise thanks alot

fabe-mrcl
Автор

Great tutorial. Well explained watching from Bangladesh. Thank you.

ummayhoney
Автор

Very good, you helped me in Indonesia. Thank you.

dzakarahadi
Автор

Great, thanks for sharing your knowledge.

dineshmali
Автор

Do we have a choice to add foreign key in any of both tabels? Why you added in customers table and not in company, ? What if you added in company table will it work?

AmeerHamza-cykm
Автор

For anyone who gets this error: with message 'SQLSTATE[HY000]: General error: 1 no such table: companies. You should type in termianl: php artisan migrate @2:12.

arash_mehrabi
Автор

For Visual studio code user, use PHP artisan extension and get rid of the terminal... you're welcome

RustineDave