f you're looking to level up your Laravel skills? My new course "Mastering Laravel 10 Query Builder, Eloquent & Relationships" is the perfect opportunity: www.udemy.com/course/mastering-laravel-10-query-builder-eloquent-relationships/?referralCode=C784C3DB5B8925207FCB
This series has been great and was just what I was hoping for when I suggested an api course. I'm building a laravel api for my angular frontend school project right now, and I've learned a lot from your series, only big difference is that I chose to use Sanctum instead of Passport. I hope to see more videos from you Dary!
Great video, thanks for this. Just was a bit disturbed on how the Eloquent Relationships were done, please read again the documentation and you'll see that this is MUCH more simple now.
Thank you for sharing. I'll have a look into it. I sometimes don't agree with the documentation and think that a old way might be better, but I got to say you are right on this one! :)
I don't know if anyone has pointed this out yet but at 5:56 or so, your "create" is not POST, but also GET. You even say "POST" but wrote GET on the chart. Thought I'd point that out - maybe you can patch it with one of those overlay messages, whatever they're called...
Hi, your tutorial are really helpful and easy to understand but I got a question. When sending a API Post do we need CSRF token and do you have a tutorial for that? thank you
When using Laravel Passport, CSRF protection is not necessary for API routes because they are typically consumed by other applications rather than by a user's browser directly.
Just want to ask. Whats the better way to call an api? 1. View(request)->controller(call api)->api_controller(return response)->controller(return response)->view 2. View(request)->api_controller(return response)->view My colleagues said 1, but I think if we'll use AJAX, 2 would be better? (Not sure tho)
hi and thank you for this cool video. after i do laravle new appname ... there war sanctiom already includet ... is this the new 'default' auth from laravel now ?
thanks a lot great work there....Well Done Bravo!!! How can a user signup and get the API Secret Token to have access to the API End-Point....Once again thanks a lot in your endeavors Dary
First time I learn a lot how build API thank you!! In my case I use Laravel 9 it is a bit different than Laravel 8 by Sanctum so I disabled this api to use with Passport. But overall amazing!!
Api isn't necessarily a beginners topic, like I have mentioned in the beginning. In the beginners course, you will find out that the same exact issue you mentioned will be solves inside the migration ->cascade('delete'); Sorry if something was unclear, but I obviously can't keep explaining these things.
1:02:00 if you get AuthorsController not found error, add the target of controller and change the class name inside the controller also. In video Dary changes only the class name and I guess IDE makes changes automatically.
I really like your courses and the way you explain what are you doing. Just a small feedback which, IMO would help you create even better content: You could also explain 'why things work this way' . For instance, the api route has a prefix of api - I would have liked to see a reference to the route service provider with the 'api' prefix to the route. Thank you for your effort!
@@codewithdary now i feel sorry, that i mentioned it. Don't be too hard on yourself! This is just a small mistake in the middle of an overall perfect tutorial. ;)
@@fleckenfurz77 no worries about it. Don’t mind if people do, makes me realize that tons of people are watching and I got to be more careful with the content I bring out! Can’t make small mistakes like these! Thank you anyways
Hi @CodeWithDary , I appreciate your work but there is an error in last couple of minutes. BookAuthor table . When you see single book other data from book_author data change automatically.
Thank you Dary , Your Courses are awesome.. We will be waiting for more especially on Laravel and Vue js ! I hope you'll create some Full stack projects too .. Thank you again 🙏
hi in laravel 9 i dont have to make changes in provider file and config right? because i provider file when i write passport::routes() show me error wnd when i delete it it works
Not anymore I think. It has been change since this video was for Laravel 8. I have creaed a Short about it which might help you: ruclips.net/user/shortsFI8mxv14v-k
At 1:42:05 you don't care about the id being a string like you did in the resources. As the authors are not going through the AuthorResource, how can I modify the ids to be strings as well?
Copies from the JSON documentation: Every resource object MUST contain an id member and a type member. The values of the id and type members MUST be strings.
Yes it definitely can be. I think that a resource is represented in our document as a resource object that must contain an id and type member, both with a string datatype.
Get stuck here, 1:14:10 I am getting "message": "This action is unauthorized.", error. Really don't know why. GET method works but POST doesn't work. Solution: Request type changed to StoreAuthorRequest in my version. I return to Request and it worked. Thanks.
hello sir can you tell me pls how can i connect mysql database to xampp in macbook i am new user of macbook pls tell me step by step it will be huge help for me thanksyou so much
at 48:39 I get this error: { "error": "invalid_client", "error_description": "Client authentication failed", "message": "Client authentication failed" } 401: Unauthorized My laravel version 8.76.0 is there way to fix it?
Hello nice video, but I keep getting an error when I try to get the Oauth/token endpoint via postman . I get it was not possible to parse your key, reason. Please help
How to make a Website and API REST with the same Controllers? It is possible I'm totally confused, and how to create both are same Controllers, plz help
at 1:14:10 , I try to call the api using the post method, But getting the 404, How you used the Request parameter in Update() AuthorsController.php( public function update(UpdateAuthorRequest $request, Author $author))
ruclips.net/video/xvqPEEpRBJ4/видео.html This api authorization is returning 401 status code and {"message":"Unauthenticated."} for Laravel 9.x version is there any changes made?
It's very easy to bash something that doesn't have English as his first speaking language though. Your basically saying that if you make spelling or pronunciation mistakes, you shouldn't be talking English? Interesting...
f you're looking to level up your Laravel skills? My new course "Mastering Laravel 10 Query Builder, Eloquent & Relationships" is the perfect opportunity: www.udemy.com/course/mastering-laravel-10-query-builder-eloquent-relationships/?referralCode=C784C3DB5B8925207FCB
This is the best video for Laravel Rest api with authentication, I have ever seen from 2018.
Thank you so much Ajay!
This is by far the best Laravel API tutorial i have ever come across.
Wow, thank you so much Gilles!
Excellent Laravel AP tutorialI. no comments!
Love that. Thank you so much :)
This series has been great and was just what I was hoping for when I suggested an api course. I'm building a laravel api for my angular frontend school project right now, and I've learned a lot from your series, only big difference is that I chose to use Sanctum instead of Passport. I hope to see more videos from you Dary!
Thank you man, appreciate the kind words dude! :)
any watching this video in 2024? thanks dary for good content
Excellent Laravel AP tutorialI, should easily rank at the top of list. Thanks for such wonderfully explained and taught lessons.
Thank you so much man. We will get there :)
Nice and helpful tutorial. One question "Passport (or) Sanctum". When to use what ??
Depends on the size of your applications. I recommend Sanctum for small apps because it's a bit simpler and easier to use.
NL: Bedankt voor alle tutorials, ze zijn erg leerzaam!
EN: Many thanks for making all the tutorials, they are very educational!
Geen problem! Doe mijn best om je te helpen!
Great video, thanks for this.
Just was a bit disturbed on how the Eloquent Relationships were done, please read again the documentation and you'll see that this is MUCH more simple now.
What relationship are you talking about? Can you please add a timestamp so I can look into it? Anyways thanks for the feedback buddy! :D
@@codewithdary Sorry, I forgot to point the location. It's from 1:37:15 on.
This is done easier if you follow the documentation.
Thank you for sharing. I'll have a look into it. I sometimes don't agree with the documentation and think that a old way might be better, but I got to say you are right on this one! :)
I don't know if anyone has pointed this out yet but at 5:56 or so, your "create" is not
POST, but also GET. You even say "POST" but wrote GET on the chart. Thought I'd point that out - maybe you can patch it with one of those overlay messages, whatever they're called...
Yep :( and I regret it...
That sounds like a solid solution tbh. Thank you
It's great tutorial and easy to understand. Thanks a lot ...
You are welcome!
Your this series is mind blowing 😉 looking for more tutorials ☺
Thank you ❤
Glad you like them!
Thank you Dary, you are a life saver. 🥺. You teaching is really simple and easy to understand.
You're very welcome Joshua!
Amazing... A complete package
Worth watching and A ton of thanks for your contribution.
So nice of you man :)
@@codewithdary I literally type letter by letter with u.............Thanks
Hi, your tutorial are really helpful and easy to understand but I got a question. When sending a API Post do we need CSRF token and do you have a tutorial for that? thank you
When using Laravel Passport, CSRF protection is not necessary for API routes because they are typically consumed by other applications rather than by a user's browser directly.
Hi @@codewithdary I'm using Laravel Sanctum from also your video tutorial. Thank you
Thankyou Dary.. Such a Awesome Course and i am your new subscriber./😊
Thank you Anjali, I won't disappoint you :)
Just want to ask. Whats the better way to call an api?
1. View(request)->controller(call api)->api_controller(return response)->controller(return response)->view
2. View(request)->api_controller(return response)->view
My colleagues said 1, but I think if we'll use AJAX, 2 would be better? (Not sure tho)
I like the first method. But I do wonder why you think ti's better for Ajax. Any reasoning for that? (just wondering)
Man, you nailed it. Bravo
Thank you Abdullah!
hi and thank you for this cool video.
after i do laravle new appname ... there war sanctiom already includet ... is this the new 'default' auth from laravel now ?
Thank you so much
Honestly a great course, I hoped to learn how to use API via javascript and blade views
Future topic bud! :)
thanks a lot great work there....Well Done Bravo!!! How can a user signup and get the API Secret Token to have access to the API End-Point....Once again thanks a lot in your endeavors Dary
Thank you for good tutorial. Except the last chapter I understand well i think.
Glad to hear that!
Great tutorial, it has me looking at JSON:API Standards. Will you be continuing on to a front end for this api?
Thank you! I haven't schedules anything for the frontend though but I like the idea, thanks! :)
Good Crash Course - Thanks
But You didn't show how to send custom response if show method fails. For example if i want to get book with id 9999 :D
Thank you! :) Haha yeah there are obivously 28498393 things that you could add, but had to draw the line somewhere!
@@codewithdary thanks for Your work
First time I learn a lot how build API thank you!! In my case I use Laravel 9 it is a bit different than Laravel 8 by Sanctum so I disabled this api to use with Passport. But overall amazing!!
You can obviously still use Passport though. The idea behind Passport and Sanctum is the same but they are both used for different type of projects!
@@codewithdary right
Thank you for the tutorial simple and straight like the laravel course wish you the best
Thank you so much man :)
Hi, Dary! Awesome video tutorial. I just learned about The Thunder Client extension for VS Code, Rest Client for Testing APIs.
Good to hear that Dana. Do you like the extension?
@@codewithdary I like it but I also like Postman.
Yeah I feel you. I used to work with the Chrome extension which I also really liked to use.
It's called Advanced Rest Client for Chrome: chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
How would the model and controller behave if there is no author with the provided id? I think error handling should be explained in this video
Api isn't necessarily a beginners topic, like I have mentioned in the beginning.
In the beginners course, you will find out that the same exact issue you mentioned will be solves inside the migration ->cascade('delete');
Sorry if something was unclear, but I obviously can't keep explaining these things.
Information here is mind blowing
Good or bad?
1:02:00
if you get AuthorsController not found error, add the target of controller and change the class name inside the controller also. In video Dary changes only the class name and I guess IDE makes changes automatically.
Yes I'm using the PHP Intelephense extension that will handle that for me :)
I am having the same issue. Can you explain how you solved it?
Nevermind. We have to add path to the Authorscontroller.php file in api.php file
Absoulately fantastic , thanks a lot sir
Most welcome!
I really like your courses and the way you explain what are you doing. Just a small feedback which, IMO would help you create even better content: You could also explain 'why things work this way' . For instance, the api route has a prefix of api - I would have liked to see a reference to the route service provider with the 'api' prefix to the route. Thank you for your effort!
Hi Oana. Thank you for your nice words and also another big thank you for providing me feedback! :)
Started watching hope it will be good will update comment later after watching. Thanks 😇
Hope you like it Mohsan! :)
Hi Dary! Thx for the tutorial!
little correction: i think you mean POST as Reqest and Http Verb at 6:30min
I messed up there :(
Thank you anyways.
@@codewithdary now i feel sorry, that i mentioned it. Don't be too hard on yourself!
This is just a small mistake in the middle of an overall perfect tutorial. ;)
@@fleckenfurz77 no worries about it. Don’t mind if people do, makes me realize that tons of people are watching and I got to be more careful with the content I bring out! Can’t make small mistakes like these! Thank you anyways
What a great explanation
Thank you so much Salar, keep on going!
Thank you Dary
Thank you for watching Kenan :)
The Laravel Passport is necessary or optional?
Thank you dary for the best ever explain
Happy to help!
Hi @CodeWithDary , I appreciate your work but there is an error in last couple of minutes. BookAuthor table . When you see single book other data from book_author data change automatically.
I love your videos! Will you be creating a series with laravel and graphQL?
Hmm that sounds interesting! Thank you for sharing
Great tutorial Dary.
Brother Ebony thank you man! :)
perfect crash course
Thank you James!
This tutorial is amazing, thank you.
You're very welcome!
Thank you Dary , Your Courses are awesome.. We will be waiting for more especially on Laravel and Vue js !
I hope you'll create some Full stack projects too ..
Thank you again 🙏
Not sure if it will be soon but I'll definitely think about it Murad
Take your time !
Me also.. Vue laravel
hi
in laravel 9 i dont have to make changes in provider file and config right? because i provider file when i write passport::routes() show me error wnd when i delete it it works
Not anymore I think. It has been change since this video was for Laravel 8. I have creaed a Short about it which might help you: ruclips.net/user/shortsFI8mxv14v-k
@@codewithdary thank you very much
Thank you Dary , Your Courses are awesome!!!
You're very welcome Bruno!
how difference with Lumen Laravel ?
Speed! Lumen is faster ;)
Thank you bro.
Always welcome bro
At 1:42:05 you don't care about the id being a string like you did in the resources. As the authors are not going through the AuthorResource, how can I modify the ids to be strings as well?
Copies from the JSON documentation: Every resource object MUST contain an id member and a type member. The values of the id and type members MUST be strings.
@@codewithdary So, you would you not do it?
Amazing video. Thanks bro!!!
Do you plan creating vídeos teaching how to use Vue/NuxtJS and an SPA and GraphQL with Lighthouse (laravel)?
Not planned tbh, but a great suggestion
@@codewithdary ;)
How you are getting the data in show method without invoking Database, TIME: 1hr.05min. I am not getting that
What are you getting?
Thank you Dary, awesome
Thank you for watching! :)
1:08:49 , the json value must be string? but I remember the value can be number, string, boolean. I'm wrong?
Yes it definitely can be. I think that a resource is represented in our document as a resource object that must contain an id and type member, both with a string datatype.
awesome!
Thank you! Cheers!
Thank u so much! Can you share source code???
I think it is in the description.
Could you do a video showing how to apply fetch api in laravel?
I'll definitely do it later on!
Get stuck here, 1:14:10
I am getting "message": "This action is unauthorized.", error. Really don't know why.
GET method works but POST doesn't work.
Solution: Request type changed to StoreAuthorRequest in my version. I return to Request and it worked.
Thanks.
Had the same problem, my solution was to change the app/Http/Requests/StoreAuthorRequest/authorize() return value to true
@@jasonb202020 It's work on me! Thanks! :)
@@jasonb202020 Thanks Man
@@jasonb202020 POST works now, but PUT still throws 'This action is unauthorized', any solution for this problem?
Спасибо большое
Thank you for watching Ibrohim :)
hello sir can you tell me pls how can i connect mysql database to xampp in macbook i am new user of macbook pls tell me step by step it will be huge help for me thanksyou so much
Hi! This article should help you out: www.kaanburaksener.com/blog/installing-laravel-on-mac-os-x-with-xampp/
Thank you for all of your effort. God Bless you @code with dary
Thank you Gunjan, we keep going!!
I am getting a message of "unathenticated" in a GET request after puttng KEY= Authorization and VALUE = Bearer accessToken
oh sorry, my bad! There was auth:santum instead of auth:api in the Route, on the file named api.php
Haha! I've been there buddy!
@@codewithdary Thanks for all the effort you made by making such informative videos. I am growing with you. Thank you once again :)
Great..
Thank you!
At 6:18 the create verb should be Post. A little correction
Biggest mistake in all my tutorials :(
May God bless you son
Thank you man :)
at 48:39 I get this error:
{
"error": "invalid_client",
"error_description": "Client authentication failed",
"message": "Client authentication failed"
}
401: Unauthorized
My laravel version 8.76.0
is there way to fix it?
Looks like you have missed the publishing of the keys from passport config php artisan vendor:publish --tag=passport-config.
@@codewithdary It still not working after I use php artisan vendor:publish --tag=passport-config
Hello nice video, but I keep getting an error when I try to get the Oauth/token endpoint via postman .
I get it was not possible to parse your key, reason. Please help
How to make a Website and API REST with the same Controllers? It is possible I'm totally confused, and how to create both are same Controllers, plz help
I don't understand your question, sorry...
@@codewithdary I think he's trying to ask if you could make a tutorial on building a frontend design using Laravel to fetch API
at 1:14:10 , I try to call the api using the post method, But getting the 404, How you used the Request parameter in Update() AuthorsController.php( public function update(UpdateAuthorRequest $request, Author $author))
Post on update? You need to check that :)
@@codewithdary - Thanks , I solved it at last
ruclips.net/video/xvqPEEpRBJ4/видео.html This api authorization is returning 401 status code and {"message":"Unauthenticated."} for Laravel 9.x version is there any changes made?
You should compare it with the official documentation: laravel.com/docs/9.x/passport
LETS CONNECT THROUGH INSTAGRAM.
instagram.com/codewithdary
yesss
Let's go Mourad!
@@codewithdary please continue this tutorial with upload files and user avatar .. roles and permissions.
when speaking English, you should be able to speak a "th" correctly - besides that: thanks for these videos!
It's very easy to bash something that doesn't have English as his first speaking language though. Your basically saying that if you make spelling or pronunciation mistakes, you shouldn't be talking English? Interesting...
not beginner friendly
It’s obviously not the basic Laravel topics since that’s what you need to learn before moving to Laravel API.
thank you so much dary
Thank you for watching :)
Thank you. 👍
Thank you for watching! :)