Introduction To Eloquent | Laravel For Beginners | Learn Laravel

  Рет қаралды 52,006

Code With Dary

Code With Dary

3 жыл бұрын

This video will show you how to work with Laravel’s ORM tool called Eloquent. Eloquent stands out for its simplicity - Learn one of the most popular PHP frameworks for its advanced features, templating engine, fast commands and security.
📚 New Udemy Course
If you're looking to level up your Laravel skills, my new course "Udemy Migirations, Seeders, Factories, Query Builder, Eloquent & Relationships" is the perfect opportunity. Learn the essential tools and techniques for building robust and scalable web applications with Laravel: www.udemy.com/course/masterin...
📲 Let’s plan a meeting
Plan a (paid) 1-hour meeting on Calendly to do portfolio reviews, code reviews resume reviews or a coaching session for Laravel. Please read the description before booking: calendly.com/codewithdary
💌 Newsletter
Sign up for my free weekly email newsletter: www.newsletter.codewithdary.com
🔥 Resources
- PHP Hosting (10% DISCOUNT): www.hostinger.com/codewithdary
- TikTok: / codewithdary
- Instagram: / codewithdary
- Twitter: / codewithdary
- Blog: blog.codewithdary.com/
- Newsletter: newsletter.codewithdary.com/
- Patreon: www.patreon.com/user?u=30307830
- GitHub: github.com/codewithdary
Want to learn more?
- Courses: / @codewithdary
#laravel #laravel8 #php #introduction

Пікірлер: 155
@codewithdary
@codewithdary 2 жыл бұрын
LETS CONNECT THROUGH INSTAGRAM. www.Instagram.com/codewithdary
@rajeshbudhathoki7888
@rajeshbudhathoki7888 3 жыл бұрын
I think you made a mistake at 38:18 while implementing edit and update method, the following code was returning the first row from the database: $car = Car::find($id)->first(); I omitted the first() method as the following and it worked: $car = Car::find($id); Thanks!
@yeasinarafat8227
@yeasinarafat8227 2 жыл бұрын
I have got the problem about this issue. Thanks for your comments!
@ahahahathanks5060
@ahahahathanks5060 2 жыл бұрын
thanks, it helped!
@tanveermalik5907
@tanveermalik5907 2 жыл бұрын
Isn't this a bit 'disappointing' not to see a response from `Code With Dary'?
@niklaswennerstrand1010
@niklaswennerstrand1010 2 жыл бұрын
Thanks for your fix Rajesh. It prevented the selection to always get Audi as the id to edit. Always getting id 1 to edit no matter what item you wanted to edit. It did work in the video but that was because Daryl selected id Nr 1 to edit.
@wmafendi
@wmafendi Жыл бұрын
great!
@sulaimanmisri9570
@sulaimanmisri9570 3 жыл бұрын
Hey Dary. I just love your tutorial. For junior-level like me, your tutorials help me a lot. Thank you so much. And if I can share with you, before this I code using your code (which is I found more readable for junior level). Later when I do some research, I found we can simplify your code (Refer to minutes 31:17. At store part). What I do is I refactor the code and my code after that is like this : $product = Product::create($request->only('name', 'founded', 'description'));
@fredriksundgren2326
@fredriksundgren2326 2 жыл бұрын
Thank you so much Dary for these tutorials. Im working on a school project and your videos are worth more then gold.
@codewithdary
@codewithdary 2 жыл бұрын
Happy to help Fredrik! Rock that sh*t!
@richardracine9055
@richardracine9055 Жыл бұрын
Thank you for this great tutorial . I especially appreciate how the flow mirrors the laravel docs.
@codewithdary
@codewithdary Жыл бұрын
Thank you Richard, I'll try my best to work around the Laravel docs!
@sirbangalot569
@sirbangalot569 3 жыл бұрын
👏👏👏 Most definitely recommending this to the guys at work.
@codewithdary
@codewithdary 3 жыл бұрын
Wow that's awesome! :D
@richardracine9055
@richardracine9055 Жыл бұрын
Awesome tutorial, Dary. Thank you very much.
@codewithdary
@codewithdary Жыл бұрын
You're very welcome Richard!
@value-for-money
@value-for-money 3 жыл бұрын
Thanks a lot for your amazing tutorial. Love your teaching style :) Wish you make dedicated Playlist about Laravel Livewire since it make Laravel more more powerful :D
@codewithdary
@codewithdary 3 жыл бұрын
Hi! Thanks man, appreciate the honesty. I will probably do it after this one since I’m getting a lot of requests about it. Thanks!
@siidsharma7810
@siidsharma7810 3 жыл бұрын
thank you so much for this tutorial, can you please build a project in laravel with react JS, I could not find any react project in laravel
@codewithdary
@codewithdary 3 жыл бұрын
Great suggestion!
@muzika5001
@muzika5001 2 жыл бұрын
Amazing tutorial! :)
@jensknaack9016
@jensknaack9016 2 жыл бұрын
A very good tutorial. Thank you very much.
@codewithdary
@codewithdary 2 жыл бұрын
Glad it was helpful!
@ryanseguiro5479
@ryanseguiro5479 11 ай бұрын
Man thankyou so much, you helped me a LOT! ❣️😎
@codewithdary
@codewithdary 11 ай бұрын
Thank you for waching Ryan!!
@user-od1lv8le8w
@user-od1lv8le8w 8 ай бұрын
Thanks , great tutorial
@codewithdary
@codewithdary 8 ай бұрын
You're welcome!
@msaadcartoon5617
@msaadcartoon5617 2 жыл бұрын
I like your way of teaching i love it ; keep it up,
@codewithdary
@codewithdary 2 жыл бұрын
Thank you, I will!!
@ahmadrio
@ahmadrio Жыл бұрын
terimakasih mr. dary 👍
@codewithdary
@codewithdary Жыл бұрын
@notexpert8902
@notexpert8902 3 жыл бұрын
Great tutorials 👌 Will there be some kind of bigger project in Laravel 8 like e-commerce site or something similar? Greetings from Bosnia :)
@codewithdary
@codewithdary 3 жыл бұрын
Hi! Yes, that’s eventually where I’m going to with this course. Got to teach the basics and stuff to get there.
@smurffronda2951
@smurffronda2951 Жыл бұрын
Thank you, Dary!
@codewithdary
@codewithdary Жыл бұрын
Thank you for watching :)
@elkhanhamet2561
@elkhanhamet2561 3 жыл бұрын
thank you Dary!!!👍👍👍
@codewithdary
@codewithdary 3 жыл бұрын
You are so welcome!
@siidsharma7810
@siidsharma7810 3 жыл бұрын
You’ll have 100k subscribers very soon, best of luck
@codewithdary
@codewithdary 3 жыл бұрын
Goals brother. I'll do my best :)
@upperlip
@upperlip 3 жыл бұрын
Hi Dary, when looping through data passed via the controller, I sometimes see {{ $item['description'] }} instead of {{ $item->description }}. Both in the context of eloquent. Are both interchangeable?
@codewithdary
@codewithdary 3 жыл бұрын
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.
@muhdbasiirzulkifle5090
@muhdbasiirzulkifle5090 2 жыл бұрын
Thank you for the excellent tutorial. Can I request to see your desk setup? Thank you.
@codewithdary
@codewithdary 2 жыл бұрын
My setup is very simple, just an external monitor and my laptop. Most likely will not make a video about it just because I don't like to record myself haha! :)
@muhdbasiirzulkifle5090
@muhdbasiirzulkifle5090 6 ай бұрын
@@codewithdary do you have a favourite keyboard?
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 жыл бұрын
Thanks for the TailwindCSS bro ;)
@codewithdary
@codewithdary 3 жыл бұрын
More than welcome Josue!
@emmanuelasaolu5745
@emmanuelasaolu5745 3 жыл бұрын
Dary... I love you. Please, don't stop the videos... They're really awesome... Keep them going man.
@codewithdary
@codewithdary 3 жыл бұрын
People like you are the reason why I do this man. I get very satisfied from the fact that I can teach people cool stuff, whether it’s 10, 100 of 1000000 people! :D
@OnlyJavascript
@OnlyJavascript 3 жыл бұрын
@@codewithdary That's why we love you Dary
@tallitvak5325
@tallitvak5325 3 жыл бұрын
love you man!!!!
@codewithdary
@codewithdary 3 жыл бұрын
A lot of love back from over here!
@marcgeonet8796
@marcgeonet8796 2 жыл бұрын
Hello Dary, first of all i'm so happy to find your channel. I learn a lot of things in a great way and thank you for it. Just a question about the Route::resource in the web.php page( around 4'18''), but maybe something has changed in laravel. Your method "Route::resource('/cars', CarsController::class);" with the view page index.blade.php in a subdirectory cars in views directory doesn't seem to work with me. I need to put the index.blade.php directly in the views folder and use the next method "Route::resource('cars', CarsController::class);" to make it work with the url localhost:8000/cars. Do you think it is the wright way to proceed ? Thx a lot. Marc
@nathanstanfordsr
@nathanstanfordsr 2 жыл бұрын
Not sure what I missed rewatched to find it. Somehow my tailwindcss did not get put in my app.css - Where in the video do I make sure that my app.css is not empty?
@nimasaleh4923
@nimasaleh4923 2 жыл бұрын
did you resolve your problem? I'm having the same issue. please help
@leeyoung5765
@leeyoung5765 2 жыл бұрын
@@nimasaleh4923 Me too.
@gietece
@gietece 3 жыл бұрын
Hi, there seems to be an error at 37:50 $car = Car::find($id)->first(); when i try to edit car with id=3, the displayed values are from id=1, removing first() seems to work ok. BTW great tutorial, thanks!
@SwitchedOn
@SwitchedOn 3 жыл бұрын
yes, same here.... changed mine to; $car = Car::where('id', '=', $id)->first();
@ugurd3mir
@ugurd3mir 3 жыл бұрын
@@SwitchedOn I just removed the first() method and it works.
@hussainhakimi8028
@hussainhakimi8028 2 жыл бұрын
@@SwitchedOn thank you
@joemarvillagracia4078
@joemarvillagracia4078 2 жыл бұрын
Thanks i learn much
@codewithdary
@codewithdary 2 жыл бұрын
You're welcome!
@bassemchrist74
@bassemchrist74 Жыл бұрын
pay attention colleagues : that the return view in CarsController file must be: return view('cars.index'); and not: return view('index'); otherwise you will get no view at the browser.
@codewithdary
@codewithdary Жыл бұрын
Thank you for sharing.
@felixluk3167
@felixluk3167 Жыл бұрын
Hi Dary, maybe this is a dumb question. I tried to search for answers on the Internet but wasn't able to find one. At 21:15 you changed the get() to firstOrFail(), which caused the frontend to bork with an "Trying to get property 'founded' of non-object" error. My question is, why did that happen? the firstOrFail() returned an array with one row, which the @foreach should be able to pick up and process. However, this didn't seen to be the case. So is the Laravel @foreach doesn't work with arrays with only one row?
@codewithdary
@codewithdary Жыл бұрын
It looks like you are trying to access a property that doesn't exist
@upperlip
@upperlip 3 жыл бұрын
Hi Dary, thanks for the great tutorials. I'm a bit confused about the routing here: In the web.php the uri defined in the routing is /cars, but in the browser /cars is not needed.
@codewithdary
@codewithdary 3 жыл бұрын
Yeah I made a small mistake by starting off with the / as the URI. I changed it later on to /cars when I needed to create other methods. Is that what you mean?
@codewithdary
@codewithdary 3 жыл бұрын
Show me the timestamp otherwise and I'll let you know :)
@upperlip
@upperlip 3 жыл бұрын
@@codewithdary yes that's it. Thanks a lot for the great tutorials and happy new year!
@davidfyork
@davidfyork 3 жыл бұрын
I think some might not have spotted that in the video you create index.blade.php in the views folder, not the newly created views/cars folder, which is why it worked fine in the video, but some people following along might have created it in the cars folder (so in CarsController would need to return view(‘cars.index’); instead of return view(‘index’);
@Lx45_
@Lx45_ 3 жыл бұрын
Im confused here as well, the index.blade.php file is created in the views folder, but the route points to the cars folder. Why didn't you get a 404 Error?
@shaheerarain1026
@shaheerarain1026 3 жыл бұрын
Hi appreciate your work, I am your next subscriber. Can you please share the video how you customize your terminal using ohmyzsh? Its look so good. Thanks.
@codewithdary
@codewithdary 3 жыл бұрын
Already done! Watch this video: kzfaq.info/get/bejne/mLGFgauB287XdmQ.html
@summaryofcode4573
@summaryofcode4573 2 жыл бұрын
Thanks dear
@codewithdary
@codewithdary 2 жыл бұрын
Welcome 😊
@GeekZone69
@GeekZone69 3 жыл бұрын
Best tutorial
@codewithdary
@codewithdary 3 жыл бұрын
Best viewers :D
@nibirafsan7609
@nibirafsan7609 2 жыл бұрын
Hello Dary, 1:32 I couldn't install npm, it says " 'npm' is not recognized as an internal or external command, operable program or batch file." could you please tell me the solution?
@codewithdary
@codewithdary 2 жыл бұрын
Just Download and Install Node.js from here nodejs.org/en/ If you run the downloaded file and install it, they will automatically configure for your system You don't need any other configurations anymore, now you can use the npm command anywhere
@nibirafsan7609
@nibirafsan7609 2 жыл бұрын
​@@codewithdary Thank you so much, you did a great help! :) since I already installed npm through that link, so I can skip 1:32 - 1:38 that part of that video?
@SwitchedOn
@SwitchedOn 3 жыл бұрын
I dont understand how this is working? Routes is calling for '/cars' but you dont put that URL in, you are just in the root. Then it looks from the breadcrumbs, you create 'index.blade.php' in the root of 'views' not under cars (though the folder structure does look like its nested under cars!) Really confused, I've 100% got the code the way you have done it - when I go to the root domain, I get a "404". If I browse to /cars URI, I get the index.blade.php in the root of 'views' I have set up? I'm just confused why you set up the cars directory and also why your Route is to /cars ? Great vids by the way, really enjoying learning from them!
@codewithdary
@codewithdary 3 жыл бұрын
I changed it somewhere in the video. /cars is a folder called cars with a method index. / is the index inside the views folder.
@danielevitiello1299
@danielevitiello1299 3 жыл бұрын
@@codewithdary I also encountered the same problem. We have index.blade.php stored in cars folder and Route::resource('/cars' , CarsController::class). But if you point to root in URL (so your URI is equal to '/'), how can you get the index.blade.php printed out? If I set my URI in Route::resource to '/', then in my controller I set return view('cars.index') so I can get index.blade.php pointing to root, but if I follow your set up, I get only 404. Can you explain why we have this problem? I'm sorry Dary, your videos are great!! Really! Thanks for your time and patience!!
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 жыл бұрын
This TailwindCSS preset saves a loooot of time!
@codewithdary
@codewithdary 3 жыл бұрын
Whoa, even for myself. It usually took like 30 minutes to design a basic website, Tailwind made it so much easier! Might create a course about it soon.
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 жыл бұрын
@@codewithdary cool! This is trending and saves a lot of time! A tailwind course will fit very well, thanks for sharing bro! ;) Ever heard of Livewire, AlpineJS and Jetstream? Laravel's ecossystem is soooo rich!
@codewithdary
@codewithdary 3 жыл бұрын
@@josuebarros-desenvolvedorw2490 Oh, don’t get me started on Livewire and Jetstreams! Incredible to use, will definitely do it in the future. Honestly haven’t really worked with AlphineJS. I’m currently working on React and Vue on the side, so that might be a thing for in the future as well! Btw, no idea where you’re from but have a great new year man! :D
@josuebarros-desenvolvedorw2490
@josuebarros-desenvolvedorw2490 3 жыл бұрын
@@codewithdary I'm new to Laravel, started studying 3 weeks ago and I'm in love with Livewire and Jetstreams... got my first client to work with laravel, lets hope I finish the job without bugs haha AlpineJS is almost like a VueJS but lightweight, fits perfectly well with TailwindCSS, I think you'll love it!
@OnlyJavascript
@OnlyJavascript 3 жыл бұрын
@@codewithdary can't wait to learn it
@dacpuspadewi
@dacpuspadewi 2 жыл бұрын
It's a very nice tutorial, u teaching very well, very helpful. thankyou so much.. anyway, I'm really confused about how to deal with metadata that has key and value things for eloquent laravel, let's say the user table has relation with user_meta table(that has id, key, value column). i have no idea how to deal with it and show the value based on the key(?), i hope u will create the tutorial. :)
@codewithdary
@codewithdary 2 жыл бұрын
I always recommend developers to think relationships out loud. You need to create a relationship between the users table and user_meta right? - A user has one meta (I’m guessing) - A meta has one user (I’m guessing) Then you need to create a relationship between them. We’re talking about a one to one right here.
@dacpuspadewi
@dacpuspadewi 2 жыл бұрын
@@codewithdary yeah i already made the relation and its one to many (1 user has many meta), and it solved by installing metable package from kodeine. Thanks Dary :D
@techjavaid6177
@techjavaid6177 3 жыл бұрын
Waited for 3-4 day for new videos...kindly make 3-4 a week.. Thank you, for your awesome work and quality time...love every video
@OnlyJavascript
@OnlyJavascript 3 жыл бұрын
you have enough time to practice more. utilize it bro.
@codewithdary
@codewithdary 3 жыл бұрын
Appreciate It my friend. Try to stay active and read the Laravel documentation about the specific topic in the meantime! I try to do my best
@Isthiyaquekambathagothi
@Isthiyaquekambathagothi 3 жыл бұрын
how to add image and store on database when creating ? do we have to pass the path or is there any other way?
@codewithdary
@codewithdary 3 жыл бұрын
Best way is to store the path and not the actual image. I have a video about it in this series! You should watch it! :)
@Isthiyaquekambathagothi
@Isthiyaquekambathagothi 3 жыл бұрын
@@codewithdary yes, i have watched it,i haved watched whole series, it very easy to understand, am loving it, i have started to work on test based on this series, now am stuck with a error when i tried ManyToMany Eloquents
@marktheunknown1829
@marktheunknown1829 26 күн бұрын
@@Isthiyaquekambathagothi I know it's been 3 years, but maybe for sb else is useful, that MySQL doesn't support Many to Many relationships
@Isthiyaquekambathagothi
@Isthiyaquekambathagothi 26 күн бұрын
Thanks for responding even after 3 years.. now I have been working on flutter for last 3 years
@benbigrasvirtualtourswebde7116
@benbigrasvirtualtourswebde7116 3 жыл бұрын
Hi Dary, something threw me off, around the 5 minute mark of this video. You set your route end point to "/cars" but then again everything works from the root URL. I would expect that you would need to add "/cars" in the URL to have this work, but it seems to work from the root URL. why?
@tech-trials
@tech-trials 3 жыл бұрын
There seems to be a small mistake Dont change 'web.php' Route::resource('/cars', CarsController::class); leave it as Route::resource('/', CarsController::class); Rather change 'CarsController.php' to public function index() { return view('cars.index'); }
@goldfngr
@goldfngr 3 жыл бұрын
neither version of web.php or the CarsController works for me..
@tech-trials
@tech-trials 3 жыл бұрын
@@goldfngr 2 checks are you using laravel 8 and is your view in 'views/cars/index.blade.php' or 'views/index.blade.php'
@codewithdary
@codewithdary 3 жыл бұрын
Routes: Route::resource('/cars', CarsController::class); Controller: public function index() { //Query builder //$cars = DB::table('cars')->paginate(4); $cars = Car::paginate(3); return view('cars.index', [ 'cars' => $cars ]); }
@codewithdary
@codewithdary 3 жыл бұрын
I honestly have no idea what happened over there. I thought I changed it in the video, lol!
@CODINGVENTURE
@CODINGVENTURE 2 жыл бұрын
Adding the tailwinds preset does not work for me for some reason, I’m not sure if its my windows configuration for composer
@codewithdary
@codewithdary 2 жыл бұрын
Is has been depreciated. I've got different videos on how you could setup TailwindCSS or the easiest way is implementing Laravel Breeze :)
@CODINGVENTURE
@CODINGVENTURE 2 жыл бұрын
@@codewithdary thank you I would to over that. I’m currently going through the udemy cloudways course
@charitysimon-peraboh5555
@charitysimon-peraboh5555 2 жыл бұрын
Hello Mr. Dary, thanks so much for the video, after deleting welcome.php and creating cars/index.php then changing route to Route::resource('/cars', CarsController::class) it results in error 404. Pls has anybody the same error as me? I need help pls.
@tusharagrawal5458
@tusharagrawal5458 2 жыл бұрын
same. Have you found any solution?
@charitysimon-peraboh5555
@charitysimon-peraboh5555 2 жыл бұрын
@@tusharagrawal5458 no sir, will be grate for your help
@harisshahjahan1090
@harisshahjahan1090 2 жыл бұрын
have you found a solution for this yet?
@charitysimon-peraboh5555
@charitysimon-peraboh5555 2 жыл бұрын
@@harisshahjahan1090 No sir
@harisshahjahan1090
@harisshahjahan1090 2 жыл бұрын
@@charitysimon-peraboh5555 Inside your carscontroller file change the index method such that, Public function index (){ return view ('cars.index'); } Inside your Web.php file your route will be, Route:resource('/cars', CarsController::class); And then access 127.0.0.1:8000/cars. This should work
@PunLlarena
@PunLlarena 2 жыл бұрын
Edit: Don't mind this comment, I just forgot to put in @csrf 28:43 I'm on Laravel 9.7 Using GET, HEAD, PUT, PATCH, DELETE method in route isn't supported anymore
@codewithdary
@codewithdary 2 жыл бұрын
Erhm, what?
@PunLlarena
@PunLlarena 2 жыл бұрын
Never mind this comment, I forgot to put @csrf
@nimasaleh4923
@nimasaleh4923 2 жыл бұрын
Hello.. can anyone help me? at 5:56 Dary shows his app.css inside public -> css -> app.css When i check my app.css its all empty. Why is that??
@codewithdary
@codewithdary 2 жыл бұрын
This is a video series where I have added Tailwindcss into my project :)
@nimasaleh4923
@nimasaleh4923 2 жыл бұрын
@@codewithdary Thanks Dary!! You make really awesome videos!
@codewithdary
@codewithdary 2 жыл бұрын
I make awesome videos for awesome people! :)
@carlfranz6805
@carlfranz6805 2 жыл бұрын
um. My 'css/app.css' has nothing in it. What did I forget to do?
@blobbyblue02
@blobbyblue02 2 жыл бұрын
4:16 for me "Route::resource('/', CarsController::class);" didn't work, I had to use "Route::resource('/', 'CarsController');" that seemed to work. I hope I helped someone with this, this was very hard to find out.
@davidrowlands8548
@davidrowlands8548 3 жыл бұрын
I finished the video set up the entire CRUD application, but never got Tailwind to work.
@codewithdary
@codewithdary 3 жыл бұрын
Why?
@davidrowlands8548
@davidrowlands8548 3 жыл бұрын
​@@codewithdary Followed the steps, but Tailwind just didn't work. Not sure why.
@codewithdary
@codewithdary 3 жыл бұрын
What's the error? :D
@davidrowlands8548
@davidrowlands8548 3 жыл бұрын
@@codewithdary Finally got it working!!! I made a school boy error. I wrote the CSS tag wrong. I had instead of: I forgot to add: rel=
@danb9393
@danb9393 2 жыл бұрын
5:03 ,i got 404 not found.what is the reason
@danb9393
@danb9393 2 жыл бұрын
5:08
@codewithdary
@codewithdary 2 жыл бұрын
Your endpoint is wrong. Perform php artisan route:list to see your endpoints.
@danb9393
@danb9393 2 жыл бұрын
@@codewithdary thanks.it works
@biancaschuurman2213
@biancaschuurman2213 3 жыл бұрын
Hi Dary, thank you for the video. It is great! Someone wrote this in the comments: We have index.blade.php stored in cars folder and Route::resource('/cars' , CarsController::class). But if you point to root in URL (so your URI is equal to '/'), how can you get the index.blade.php printed out? If I set my URI in Route::resource to '/', then in my controller I set return view('cars.index') so I can get index.blade.php pointing to root, but if I follow your set up, I get only 404. Unfortunately, I am having the same problem. Could you explain why is that? Thank you in advance!
@codewithdary
@codewithdary 3 жыл бұрын
Hi Bianca, thank you for your awesome comment! Let me explain to you what’s going on. The best way to showcase this is s by running php artisan:route list in the CLI. I think I replied to that comment that I changed the route when I was recording the video and accidentality cut it out. In the project, I’ve got the following as my Route: Since we’re using the resource method right here, it will automatically detect that /cars belongs to the index method inside the CarsController (php artisan:route list). Route::resource('/cars', CarsController::class); Then inside the index method, you can define whatever route you want, but I am returning: Return view(‘cars.index’, ‘cars’ => $cars); This will search for a file inside the cars folder inside our view, where we’ve got a index.blade.php file. I think that I started off in this video by adding the index.blade.php inside the views folder, and not inside the cars folder, that’s where the issue occurs. You can do that, but then you need to return a view(‘index’) inside your index method.
@codewithdary
@codewithdary 3 жыл бұрын
It’s a long response, but I hope it make sense. 404 means that the page has not been found. So somewhere (route or index method) something is being called that doesn’t exist.
@professormeow3399
@professormeow3399 2 жыл бұрын
This is unrelated, but you made a mistake with your affiliate links (The link for one of your Laptops goes to the Laptop cooler, so you have this one twice). Maybe this doesn't matter that much, but I don want you to miss out any potential profits, you deserve every penny for the content you create.
@codewithdary
@codewithdary 2 жыл бұрын
Thank you for sharing, I'll look into it! :)
@invalidname4899
@invalidname4899 2 жыл бұрын
I dont know what happened but none of my tailwind classes are working :/
@maykelesser
@maykelesser 2 жыл бұрын
Me either. My app.css is empty after the same steps.
@graham-wright
@graham-wright 2 жыл бұрын
I'm sure you guys worked this out by now, but for future reference, I think the video missed out the command: php artisan ui tailwindcss which adds the tailwind stuff to the app.css. After working this out I had problems with mix not working. ('mix' is not recognized as an internal or external command, operable program or batch file.) - This was fixed by running npm audit fix --force and then the npm run dev.
@nimasaleh4923
@nimasaleh4923 2 жыл бұрын
@@graham-wright OMG! thank you so so much!! I kept searching on google. Your comment came to my laravel-knowledge's rescue :D
@debalinadas2022
@debalinadas2022 2 жыл бұрын
How to open that MySQL you did not tell that
@codewithdary
@codewithdary 2 жыл бұрын
It's a video series and you just watched episode 22. It's pretty much the same MySQL as any other tool though, shouldn't be worried about it too much :)
@rajabhishek2936
@rajabhishek2936 3 жыл бұрын
Awosem
Cute Barbie gadgets 🩷💛
01:00
TheSoul Music Family
Рет қаралды 76 МЛН
NO NO NO YES! (50 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:26
PANDA BOI
Рет қаралды 102 МЛН
КАК СПРЯТАТЬ КОНФЕТЫ
00:59
123 GO! Shorts Russian
Рет қаралды 2,9 МЛН
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 44 МЛН
PHP is the future
34:27
Aaron Francis
Рет қаралды 163 М.
Why is Laravel NOT used in Big Development Projects?
11:53
Stefan Mischook
Рет қаралды 164 М.
Junior Code Review: Laravel Routes, Middleware, Validation and more
19:57
Laravel Eloquent: Deeper Relationships with One Query
10:37
Laravel Daily
Рет қаралды 135 М.
Cute Barbie gadgets 🩷💛
01:00
TheSoul Music Family
Рет қаралды 76 МЛН