LETS CONNECT THROUGH INSTAGRAM. www.Instagram.com/codewithdary
@FririkurEllefsen11 ай бұрын
Thanks for the tip about using the ForElse loop and "empty". I will rewrite some of my code and use those instead of numerous IF's
@codewithdary11 ай бұрын
Yes, it helps a lot!
@OurModernWorld2 жыл бұрын
i think that you are the best tutor ever, i just love your content, your way of explaining stuff is the best, with all do respect to all other tutorial creators.✌
@codewithdary2 жыл бұрын
Thank you so much John, comments like these make my day man
@OurModernWorld2 жыл бұрын
@@codewithdary cheers
@Ahabib20092 жыл бұрын
Great Dary. Really appreciate
@codewithdary2 жыл бұрын
Glad you liked it Ahabib!
@sirbangalot5693 жыл бұрын
It's funny how I tried looking up adding foreign keys online and would always get an error...them booom💥 I do your tutorial and it works. Good work man, can't thank you enough
@codewithdary3 жыл бұрын
Always good to read that! Thank you for your kind words man!
@amiralipishdadi Жыл бұрын
thank you dary 😍 very good
@codewithdary Жыл бұрын
You're welcome 😊
@william2543 жыл бұрын
Great video as always Dary. Really appreciate
@codewithdary3 жыл бұрын
Thanks again!
@agafonovas Жыл бұрын
Love your videos man 😮
@codewithdary Жыл бұрын
Thank you
@lancespurgeon2 жыл бұрын
So much easier to understand, thanks. To build on your example of cars and car_model how would you automatically insert default 'name' with lastid create from cars table?
@fabiolisboa21563 жыл бұрын
an excelente tutorial bro you illuminated my mind thank you so much
@kemal60392 жыл бұрын
If you're having "Foreign key constraint is incorrectly formed" error, do these : 1 - On the migration file, change the type of your foreign key to unsignedBigInteger from unsignedInteger 2 - Make sure the table that foreign key belongs, is being migrated before the table(s) with foreign key. You can accomplish this by renaming its migration file, for example change the "2022_" in the start of the name to "2001_"
@codewithdary2 жыл бұрын
Thank you for sharing Kemal
@peteririogbe34443 жыл бұрын
Hello Dary. Thank you for your great tutorial. I enjoy it. Pls can you make a blog that has different categories. I need it
@codewithdary3 жыл бұрын
That's very interesting, I'll think about it :) I do got a complete tutorial on how to create a blog if you are interested.
@peteririogbe34443 жыл бұрын
@@codewithdary I have already downloaded it. I need more excellent tutorials from you. You are making my day so excited
@codewithdary3 жыл бұрын
Thank you so much Peter, you made my day with your comment! :)
@daffahanz15403 жыл бұрын
Is the 'carModels' in '$car->carModels' a relationship function residing in the Car.php model?
@codewithdary3 жыл бұрын
Yes!
@chukwuebukaohaji52852 жыл бұрын
Hello Dary, nice video. I followed everything you did word for word (though different names etc) but I keep getting an error "Invalid argument supplied for foreach()". Please help out..
@tech-trials3 жыл бұрын
At the end of this video i used '{{ $model->model_name }}' and it worked for me dunno if thats cuz i used a separate migration for carModels instead of adding it into the cars migration
@codewithdary3 жыл бұрын
You can’t access arrays with the access operator [->]. It only applies to objects. But you can use the brackets to access an array. It just depends on how you pull out data from your database. If you var_dump your array, you can see what if it's an array/object/collection
@randomyuber50123 жыл бұрын
Hey, lets say we wanna insert to the carModel table, do we have to create the controller for it aswell? Or is there another laravel magic to make this easier? Great tutorial btw!
@codewithdary3 жыл бұрын
Depends on what you want to do with the carModel, but in most cases nope.
@shafiu2833 жыл бұрын
I really like coding with Dary
@codewithdary3 жыл бұрын
Thank you Shafiu!
@Ramziddin_Rustamovv2 жыл бұрын
Hi bro , i have queation about this topic , now you insert all data manualy , if I except them from user , how can i insert them automatically in the controller . For example post's comment should only be equalto post which is blongs to when user commeted it , it should post automatically in comments table in the column of post_id .... Please answer .....
@mariuszdabrowski3073 жыл бұрын
what if I want to create a new car model with the form. I have to get car_id from somewhere. my idea is to create a private variable in the controller. I set its value in the store (id) method but if I check its value in another method I wrote storeModel (). then its value is null. help please
@codewithdary3 жыл бұрын
One way of inserting related table is using relations as: $user = User::create($user_inputs); $xyz = $user->xyz()->create($xyz_inputs); It will automatically fills the user_id in the xyz table.
@mariuszdabrowski3073 жыл бұрын
@@codewithdary in this way i must every time create new user when i want create xyz?
@JohnSmith-zl8rz4 жыл бұрын
what's the goal to "protected" the table and the "primary key"?
@codewithdary4 жыл бұрын
the property or method can be accessed within the class and by classes derived from that class
@mamaddodol35283 жыл бұрын
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'car_models.blueprint_id' in 'where clause' (SQL: select * from `car_models` where `car_models`.`blueprint_id` = 5 and `car_models`.`blueprint_id` is not null) (View: C:\xampp\htdocs\final esources\views\cars\show.blade.php) the blueprint is the car model
@santhoshkumar-sf4bc3 жыл бұрын
Hi.., how to add column to table by migration without loss of data???
@codewithdary3 жыл бұрын
Read through this link (Scroll down a bit): devdojo.com/bobbyiliev/how-to-add-a-new-column-to-an-existing-table-in-a-laravel-migration
@alexpmh4 жыл бұрын
Hello! You described one to many relationship, so why the title is 'many to many'?
@codewithdary4 жыл бұрын
Oh hell, you are completely right. Changed it! My bad :)
@rajabhishek29364 жыл бұрын
Nice video
@codewithdary4 жыл бұрын
Very nice
@shawyarshah2313 жыл бұрын
Hi Dary thanks for the amazing videos about laravel. I have been facing something I don't know how to write the query in Laravel for it. I have two tables (users & user likes) users has two columns( id, name ) and user_likes has two columns ( user_id, liked_user), how can return all the users in users table except those users that the user has already liked them in Laravel? Please! for example: user 1in users table, liked user number 2 & 4. he can see all the users except user 2 & user 4. and so on for the other users. Please help
@b1olenyleny4494 жыл бұрын
Hello, nice video, i wanted to ask you, if you could make a video how to synchronize data from checkboxes to database (i have issue when i want to insert an array of values into database from checkboxes, i want to automatically delete the unchecked checkboxes values from database) i was trying to search for it but couldnt find any solution, thank you for reading this.
@codewithdary4 жыл бұрын
Thanks for the idea!
@carlfranz68052 жыл бұрын
Um. How do we get to the 'show' function? I keep getting a 404 not found. [edit] Never mind, fixed it, although I didn't figured it out (this is, I've no idea how I fixed it). I'm getting better at debugging this mess, I guess.
@codewithdary2 жыл бұрын
Keep working on it, debugging is such an important topic when it comes to coding!
@Enol_ww3 жыл бұрын
Hey guys ! I have a question about the tables, basiclly I have a table let's say its about countries.... to insert the name of the country and population, and i also have a table that has more detail about that specific country (president,size). Here is the problem, i made a form to insert the president name and the size in the table with the details, but the foreign key here is the id of the first table...how can i make tell the form or to the controller that i dont want to let anyone to insert the id, and also to let laravel know that the id of the countri is in the url and i dont have to insert it i hope you guys understend, also... sorry for my bad english.
@aldrinedeguzman76524 жыл бұрын
Dude how to show only one model name?
@codewithdary4 жыл бұрын
Do you mean the one to one relationship?
@aldrinedeguzman76524 жыл бұрын
@@codewithdary in your video you show a1 a3 a5, how to make only one will show?
@Borma4253 жыл бұрын
what about many to many ?
@brenol21773 жыл бұрын
The most important part the guy didn't do, that is the insertions.
@codewithdary3 жыл бұрын
That guy has a name (me) and what do you mean insertions?
@brenol21773 жыл бұрын
@@codewithdary Sorry didn't mean to offend. I mean the part about how to use laravel to insert the data with relations instead of adding it manually with mysql.
@codewithdary3 жыл бұрын
Oh no I'm sorry haha I like to joke around here, sometimes it sounds a bit serious! Ah yeah. That's also a part of the one to many relationship, you are right! :)