This is the best video I have watched in my entire life up till now. Today I understand relationship and can even teach people. Thanks man.
@coderawesome Жыл бұрын
Thanks for your valuable feedback!
@mubafaw4 жыл бұрын
I appreciate your clarity and simplicity. The best!! Thanks Sir :)
@coderawesome4 жыл бұрын
Glad it was helpful!
@thesafaripictures34533 жыл бұрын
The greatest tutorial on eloquent on the web. Thank you sir.
@coderawesome3 жыл бұрын
You're very welcome!
@mxoh83252 жыл бұрын
finally, someone made example of relationships. I have been struggling for many years thank you so much for this.
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@emileoosthuizen596 Жыл бұрын
Thank you for this incredible video!
@coderawesome Жыл бұрын
Glad you enjoyed it!
@Benjamin-vx2ot2 жыл бұрын
this was by far the best video for this topic! thank you!
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@gajen4evr2 жыл бұрын
Good explanation brother..!
@coderawesome Жыл бұрын
Glad you liked it
@firedragon1976eb Жыл бұрын
This is such a great explanation, thank you.
@coderawesome Жыл бұрын
You're very welcome!
@83shahzada3 жыл бұрын
Awesome Tutorial, Complicated Scenario - Explained So Simple and Clear
@coderawesome3 жыл бұрын
Glad it was helpful! Thanks a lot for your feedback!
@ahmadbilal1683 жыл бұрын
it is so much useful for beginners.thanks for this
@coderawesome3 жыл бұрын
Glad it was helpful! Thanks!
@eidm57154 жыл бұрын
Thank you for all relevant information. I learned one important concept related to easy loading in this tutorial
@coderawesome4 жыл бұрын
Glad it was helpful!
@SaddamAnsari-df7ez2 жыл бұрын
thank you very very much sir ji
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@cloudydandy3 жыл бұрын
Thank you for your effort. I watched in Speed:1.25.
@coderawesome3 жыл бұрын
You're most welcome!
@jakye Жыл бұрын
Awesome tutorial! At 13:55 I would consider renaming the pivot table from "user_role" to "role_user" to use all of the eloquent features, because the models need to be alphabetically ordered.
@coderawesome Жыл бұрын
Yes, that's no issue! Thanks!
@azlanuza13302 жыл бұрын
It helped me learn a lot in Laravel eloquent. Good tutorial indeed.
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@rubanjacob21114 жыл бұрын
Very Nice Explanation
@coderawesome4 жыл бұрын
Thanks a lot!
@dasuneranda3 жыл бұрын
Thanks bro. Great Explanation!
@coderawesome3 жыл бұрын
Glad it was helpful! You're most welcome!
@simoneverett123 жыл бұрын
Top job, Your video really helped to the point! BANG ON!! Keep up the amazing work!!
@coderawesome3 жыл бұрын
Thanks a lot for your feedback!
@rjchhetri23703 жыл бұрын
I'm confused with the pivot table. Why dont we make hasMany relation on User model so it links to the Role Model and in Role Model we define belongsTo relation for User
@vaibhavsrivastava40993 жыл бұрын
simple and very clear..
@coderawesome3 жыл бұрын
Thanks a lot for your feedback!
@shazirshafeeque62403 жыл бұрын
Good explanation brother. You nailed it. Superb :)
@coderawesome3 жыл бұрын
Thanks bro! Glad you liked it!
@alexneo93883 жыл бұрын
Awesome Tutorial, Thanks a lot...
@coderawesome3 жыл бұрын
You're most welcome!
@Shiv-vb1re2 жыл бұрын
Thanks
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@tuanphamvan6552 жыл бұрын
very good
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@ehSamurai34833 жыл бұрын
$this->belongsToMany("App\Role") means that user belong to many roles, isn't it same as hasMany("App\Roles"). this also means that user has many roles right,
@coderawesome3 жыл бұрын
Nope. They're different. belongsToMany is a Many to Many relationship (A product can be belongs to many categories. And each category has many products), while hasMany refers to a One to Many relationship (A product can have many images, But one image only belongs to a one product.).
@rahi40303 жыл бұрын
you saved me sir thank you so much
@coderawesome3 жыл бұрын
You are most welcome
@ashadulmridha42653 жыл бұрын
Thanks You
@coderawesome3 жыл бұрын
You're most welcome!
@haykhayrapetyan14893 жыл бұрын
thanks bro, I found what I need
@coderawesome3 жыл бұрын
I'm glad that you enjoyed the tutorial. Thanks a lot for you feedback!
@thecalmcompass14 жыл бұрын
Thank you. I will practise it.
@coderawesome3 жыл бұрын
You can do it! Thanks a lot for your feedback!
@muhammadshafeerp34353 жыл бұрын
very useful video thanks
@coderawesome3 жыл бұрын
Glad it was helpful! Thanks a lot!
@TrikNgonlen3 жыл бұрын
I love it...that's awesome...
@coderawesome7 ай бұрын
Glad you liked it! You're most welcome!
@auroraapps18532 жыл бұрын
Great explanation!, please tell me what extension you are using, its mentioning prefix before string like (foreign, relation, etc ) ? please tell me
@coderawesome7 ай бұрын
Hi, I'm sorry I am not sure what you'r asking about ? What extension exactly ?
@_bihim3 жыл бұрын
Love you
@coderawesome3 жыл бұрын
Love you too brother!
@ehSamurai34833 жыл бұрын
We can do like this User::find(1)->getaddressRelation; Right? So why use with()->get()?
@coderawesome7 ай бұрын
That function came in a later version of Laravel I guess. This method works for older versions.
@KhaledGhallabPro3 жыл бұрын
Very nice Thaks..
@coderawesome3 жыл бұрын
Thanks a lot for the feedback. Much appreciated!
@MatejSK13 жыл бұрын
Hello please can you tell for example how you can get all comments from 1 user for one post ? because its very hard for me to get the certain values from object which especially if i want to do it in the table . I am making ordering system for cars and I got like 5 tables and i want to display all the datas from each to one big table, so i have to do it in foreach cycle.
@coderawesome3 жыл бұрын
It's fairly easy. You have to call a relationship within a relationship. that's it. Define getUserRelation(); relationship on Post model. And getCommentsRelation(); on User model. Then finally call it like this. Post::with('getUserRelation.getCommentsRelation')->find($id); That's it.
@michaelerwin87442 жыл бұрын
6:06 AFAIK it's die and dump but sometimes programmers and debug and die in the office.
@coderawesome2 жыл бұрын
Yeah it's been confusing for a while for me too :D
@sergey_gabrielyan10014 жыл бұрын
Thank you very much👍🏻
@coderawesome4 жыл бұрын
You are welcome!
@7421Roman3 жыл бұрын
he was not wrong with that title
@coderawesome3 жыл бұрын
Thanks! something wrong with the title ?
@7421Roman3 жыл бұрын
@@coderawesome its perfect
@MohsinKhan-sk5lh3 жыл бұрын
great
@coderawesome3 жыл бұрын
thanks brother!
@victorfernandogilcalderon62423 жыл бұрын
Excelente explicaciones. "Nos has salvado estamos agradecidos" By Toy Story
@coderawesome3 жыл бұрын
gracias por su respuesta. Me animó. 😍
@melchiasystemlord86083 жыл бұрын
is it possible to consume 1 user with many addresses all at once in 1 form submit using eloquent?
@coderawesome3 жыл бұрын
Yeah, you can pass an array of addresses like this Model::insert($data); Here, $data is a multi-dimensional array of addresses.
@nishanthanr6053 жыл бұрын
Which software you use for screen recording.
@coderawesome3 жыл бұрын
It's Camtasia
@yogeshsaini2543 жыл бұрын
Thanks sir😍
@coderawesome3 жыл бұрын
Most welcome!
@rohankumar14754 жыл бұрын
hello, i want to how this query write in laravel ORM(without where and with where) "select student.name, cities.city from students INNER JOIN cities on student.city_id=cities.id" where students.id=1 i have student table with city_id and other columns and cities table with id,city
@coderawesome3 жыл бұрын
You can achieve that with Sequelize relations easily. May be I'll do a separate video about relations later.
@2cents2go4 жыл бұрын
Great and easy to understand concepts. The only thing is that it's a little hard to see your screen since sometimes other devs and I view this on a phone.
@coderawesome4 жыл бұрын
Yeah I agree with you. Sorry about that. Thanks for your feedback!
@babathombare2693 Жыл бұрын
Content does not fit into window. Not visible neatly.
@coderawesome7 ай бұрын
Totally agreed. Really sorry about that.
@thielicious21562 жыл бұрын
4:02 What is this line in v9.x? Looks quite different
@coderawesome7 ай бұрын
This video is little bit outdated. Please refer the official Laravel docs for the updated sysntax.
@alakshminagasri30113 жыл бұрын
Can you tell me the difference between joins and relations, and when we have to use joins and relations
@coderawesome3 жыл бұрын
You JOIN tables to generate RELATIONSHIPS. When you use raw SQL, you have to manually join tables using queries to get the related data in other tables. But with an ORM which automatically writes SQL for us, all you have to do is define the relationship you wanna generate and ORM will join related tables and will output the data with relationships.
@nizz4m2 жыл бұрын
Will eloquent relationship works without table migrations ? . Btw thanks for great content !
@coderawesome7 ай бұрын
Yes it works! Just make the tables with correct foreign keys.
@nurrashiqahabdulwahid68713 жыл бұрын
thank you for the tutorials sir. im your 267 subs. it helps me to understand better but i have a question, where does the data comes from? 6:55 . are they from database or you are using php artisan tinker? i really hope you can reply me, sir as im really new in laravel. thank you sir
@coderawesome3 жыл бұрын
Thanks a lot! Yes, I have put some sample data in a table for this demonstration.
@nurrashiqahabdulwahid68713 жыл бұрын
@@coderawesome welcome sir. do you know how to fetch data from multiple table using these eloquent? ive been looking and searching everywhere and trying everything but nothing works sir. hope you can upload one soon. have a great day!
@coderawesome3 жыл бұрын
@@nurrashiqahabdulwahid6871 Sure. That's what these eloquent relationships are for. You can build relationships between tables and get data.
@nurrashiqahabdulwahid68713 жыл бұрын
@@coderawesome I got confused to use the foreach loop in view.blade.php, it's keep getting an error there. looking forward to your videos sir 🙏
@alexlytle0893 жыл бұрын
How about has many through and has one through relationship
@coderawesome3 жыл бұрын
That's not hard at all. I'm sorry that I haven't mention them in the video. Please follow this article (www.itsolutionstuff.com/post/laravel-has-many-through-eloquent-relationship-tutorialexample.html) it'll guide you with a practical example. I'll try to publish another video if I had the chance.
@harikareddy91663 жыл бұрын
hi can u explain how to fetch multiple tables data in a single view page in laravel
@coderawesome3 жыл бұрын
That's simple. In the controller, get the data from certain tables using their respective modals. Then create an array and pass those data to certain keys. Then u can return that array to the view.
@omrai77433 жыл бұрын
How can we get only selected record from belongs to table?
@coderawesome3 жыл бұрын
Can u be more specific ? There are many ways of doing. What exactly are u trying to do ?
@Lea-uu4yk2 жыл бұрын
what about recursive? the manager manage many staffs?
@coderawesome2 жыл бұрын
Is a single staff person managed by only one manager ? Then that's clearly a one to many relationship. Is a single manager is managed by multiple managers, then that's many to many.
@shubhamsahuSD2 жыл бұрын
Details about cascade delete please
@coderawesome7 ай бұрын
Cascading deletes are needed when a dependent/child entity can no longer be associated with its current principal/parent. This can happen because the principal/parent is deleted, or it can happen when the principal/parent still exists but the dependent/child is no longer associated with it.
@lyeell69893 жыл бұрын
Muchas gracias,
@coderawesome3 жыл бұрын
no hay de qué. Disculpas si mi español es malo 😇
@rajeshvuppala80833 жыл бұрын
Bro can u please share the extension that u used for getting suggestions in vscode
@coderawesome3 жыл бұрын
Actually that's PHPStorm. It's another IDE.
@rajeshvuppala80833 жыл бұрын
@@coderawesome ok thank you bro Php strom is free or paid IDE
@coderawesome3 жыл бұрын
@@rajeshvuppala8083 Unfortunately it's a paid IDE. But, if you're a student, you can request a free version with your student ID provided by the institution.
@hellwolf-media4 жыл бұрын
Excelente +10
@coderawesome4 жыл бұрын
Thanks a lot!
@danichurras3 жыл бұрын
meow meow thanks
@coderawesome3 жыл бұрын
Thanks a lot for your feedback!
@plotpix9413 жыл бұрын
Please Zoom in your screen next time
@coderawesome3 жыл бұрын
Sure! My bad. I'm sorry for the difficulty to read. Later videos are much clear and zoomed in.