Great course and even greater way of explaining how to do it. Man, it takes a great amount of skill to translate something a bit complicated in such a simple way. Great work!
It was such a fantastic course to enjoy and learn. I had a lot of confusion about API development and even don't have such good ideas in case of API development. Thank you for this course.
As far as I know, Envato is talking about design. So, when I see this video, I'm little doubtful. But, surprisingly the explanation in this video is amazing and complete. For example, the versioning of API which is crucial in development but not discussed very often in another tutorial. Why you make a programming tutorial, Envato? Hahaha. Btw, thank you
I think Laravel creates that because of the relationship 'hasMany'. Laravel is smart enough (and abstracts lots of things) to understand customer class has many invoices so it says I should create function called hasInvoices. I am not sure but I think this is the case because it runs without problem
I've come from Django, React and Vue, and hate with my soul php, BUT laravel seems quite entertaining and your video made it usable for a project of mine, thank you!
What a nice tutotial - I like it. 44:43 While implementing filter transform, I didn't understand how "[gt]" and the likes were passed and where the $oprators arrays were gotten. Please, I need clearifcation.
$adminToken = $user->createToken("admin-token", ["create", "update", "delete"]); it return form me tha the createToken method is not define on the user
Instantiate variable $user like this: $user = User::where('email', $credentials['email'])->first(); It will return App\Models\User instance, which should have HasApiTokens trait.
I'm done with the entire course, enjoyed every second of it and I'm gonna use it as reference in my upcoming projects. But Sir I have a request, could you please make a video on how to integrate Swagger docs into a laravel api? There are a couple of resources around, but most aren't helpful enough. Thank you.
This is great but needs updating for Laravel 11.x - maybe just adding some notes in the description would be enough to help people. There are quite a few changes mean that following this tutorial won't work for a lot of people. Most notably that api routes are not installed OOB anymore, so you need to need to run php artisan install:api
25:06 - unfortunately, adding a prefix to the routes just repeats (weirdly) the already 'app/http/controllers/v1/controllerName' after the given namespace; weird... so it results in something like Target class [NAMESPACE_GIVEN]\App\Http\Controllers\v1\[CONTROLLER_NAME] does does not exist. which is Target class App\Https\Controllers\v1\App\Http\Controllers\v1\[CONTROLLER_NAME] does not exist. NAMESPACE_GIVEN = App\Https\Controllers\v1
Great course! I've learned a lot from you, thank you. For the bulk insert section, you could consider moving the logic for removing the 'customerId', 'billedDate', and 'paidDate' data from the controller to a protected function called 'passedValidation' in the BulkStoreInvoiceRequest.php . What do you think? So it would look like this: protected function passedValidation(){ $data = collect($this->toArray())->map(function($arr, $key){ return Arr::except($arr, ['customerId','billedDate', 'paidDate']); })->toArray(); $this->merge($data); }
Great tutorials for thinking in advanced tips on build stronger API's. One thing, I come from LATAM, so my keyboard too, and my "not equal" symbol that it works is this: '!='
Hi loved the tutorial just one question at 27:00 you said anyone using the API would expect camelcase , but i could stg every single third party API i used even from big companies like (google/facebook etc..) use the same naming conventions as SQL in their responses ( postal_code for example) , so which one is right lol
Great course but i have a question for you: How would you handle filtering on the relationship? For example, having products with translations but i only want to get the products which have English translations.
Great tutorial, it is really appreciated. What is your reasoning for CamelCase JSON rather than snake_casing? I see some people say it makes things easier for Java/C++/Python. Thoughts?
I am following this tutorial now and everything so far is working perfectly well as told in the video. Except for the show function in the controller. When I add /1 to my API Endpoint in PostMan I just get an empty resource. When I remove the /1 I get the entire database. I am not sure why this happens. EDIT: A second issue I get it is in the PUT/PATCH section where I get an error in PostMan that says "The PUT method is not supported for route api/v1/registration/validate. Supported methods: GET, HEAD, POST." I did everything like the video said.
No it wont work because we put in rules array postalCode field name that will change into postal_code only after the $request->validated(), so you should leave it how it is with all()
Thanks for the video, very useful course! I have a small question, at 30:50 in the response results the current_page and last_page are not written in the Camel case, how can I fix this? I understand that Laravel returns this automatically, but I still want to put things in order.
This is great content, and has kick started my Laravel. I am trying this with a MongoDB, and am up to the filter. How do I do something like the Filter, but for doing it with MongoDB?
I have this issue please help: "message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'postalCode' in 'field list' (SQL: insert into `customers`, I did everything but my prepareForValidation() is not working.
Wonderfull tutorial. I hope this will help many developers. I have one question though. What if you want to save file within post request? I have tried this and got an error. I might doing something wrong when handling the request, but Laravel tools to save file doesn't working at all. If anybody did this I would appreciate if this will be hinted here in comments.
The api routes didn't work for me. You need to install the API package with the following command... php artisan install:api What's more you need to install on a clean project (i.e. immediately after project create).
how about if we have 100 abilities or 100 role to apply to applicaton that we have build, so we must generate 100 token for those abbilities or role every sign in ? and how about make new abilities or role after applicaton running ? add the createtoken to the apps mannualy every time want to add new abilites or role ?
I am facing a problem. The problem is when I give a filter parameter in string for example city[eq]=washington, it doesn't give any data but if I give parameter in number for example amount[eq]=3000 then it's working and another problem only lt,gt,eq is working for me, other's don't. How can I remove this problem?. please give me the solution.
Dude this is the best turorial I've watched so far
Please note for non-windows users you must use a forward slash rather than a backslash when using artisan make:resource folder/resourcename
This guy sounds like a mix between documentary and a flight instructor. Awesome
Exactly 😆!! that's crazy man !! I really appreciated ... Thk you
Coming from MERN, this was the best video I needed to grasp everything. Thanks lot Jeremy
Glad you enjoyed it!
Great course and even greater way of explaining how to do it. Man, it takes a great amount of skill to translate something a bit complicated in such a simple way. Great work!
Glad you enjoyed it!
@@envatotuts How to validate if customer exists when saving invoices?
True
Excellent short course. However, this needs to be updated, hope you guys would work on this one again :D
This is one of the greatest tutorials of all time, exactly what you need to know no extra bs
Best Tutor, his teaching way gives you confident to start any project.
It was such a fantastic course to enjoy and learn. I had a lot of confusion about API development and even don't have such good ideas in case of API development. Thank you for this course.
As far as I know, Envato is talking about design. So, when I see this video, I'm little doubtful. But, surprisingly the explanation in this video is amazing and complete. For example, the versioning of API which is crucial in development but not discussed very often in another tutorial. Why you make a programming tutorial, Envato? Hahaha. Btw, thank you
One of the best tutorials ever, you should make a lot more, very well explained and clear to understand
Mindblowing , the way how he illustrate and explain things
由浅入深,由表及里,层层递进。非常值得推荐的Laravel视频!👍
Would u make a tutorial about react +laravel +authontification and thnx❤
19:22 if don't see Route's data, to be seen 404 not found, Enter command "php artisan serve" in your project folder.
It is the best course i've never seen, Thank u so much!. Greetings from Venezuela
hey , from where the hasInvoices() in the seeder came from does laravel know it automatically?
yes due to the naming convention, laravel auto detects and does its magic. ofcoz the relationships have to be built
I hadn't done with Laravel for a long time. It's really helpful. Thank you for your video.
Glad it was helpful!
Ohhh VietNamese...
Im really glad that i found this channel. I hope i can watch all your videos. Thank you!
I hope so too! But, there are a lot of videos!
sir at what point did you define the method hasInvoices in the customerSeeder class .My ide flags it as undefined method.thank you
I think Laravel creates that because of the relationship 'hasMany'. Laravel is smart enough (and abstracts lots of things) to understand customer class has many invoices so it says I should create function called hasInvoices. I am not sure but I think this is the case because it runs without problem
I've come from Django, React and Vue, and hate with my soul php, BUT laravel seems quite entertaining and your video made it usable for a project of mine, thank you!
Best tutorial ever watched. keep it up. love your work.
What a nice tutotial - I like it.
44:43 While implementing filter transform, I didn't understand how "[gt]" and the likes were passed and where the $oprators arrays were gotten.
Please, I need clearifcation.
This video saved my life, props to the guy 👊👊
$adminToken = $user->createToken("admin-token", ["create", "update", "delete"]);
it return form me tha the createToken method is not define on the user
Same here. Did you manage to find a solution?
Instantiate variable $user like this:
$user = User::where('email', $credentials['email'])->first();
It will return App\Models\User instance, which should have HasApiTokens trait.
best tutorial in planet earth, period
This is a great course, excellent teacher. Very clear explanations!
Best and clear tutorial so far!
one of the best video on rest api
Thank you so much 😀
I'm done with the entire course, enjoyed every second of it and I'm gonna use it as reference in my upcoming projects. But Sir I have a request, could you please make a video on how to integrate Swagger docs into a laravel api? There are a couple of resources around, but most aren't helpful enough. Thank you.
can't recommend your tutorial enough, thanks a lot
Glad to hear that
thank for this valuable tuto, My question is there another tuto example that shows how to consume thise rest API?
This is great but needs updating for Laravel 11.x - maybe just adding some notes in the description would be enough to help people. There are quite a few changes mean that following this tutorial won't work for a lot of people. Most notably that api routes are not installed OOB anymore, so you need to need to run php artisan install:api
Thanks a lot, the first time I thought this video did not help me. But this video did help me a lot. Thank you again.
We love you Envato Tuts developer!
It helps me a lot more than anything so far....
Thank you sensei
Nice course, Could please make a video about graphQL in Laravel ?
gran video me ayudo a comprender demasiado varias partes del framework laravel y de la implementacion de sanctum
Amazing tutorial.
One-in-all.
Thanks Envato
25:06 - unfortunately, adding a prefix to the routes just repeats (weirdly) the already 'app/http/controllers/v1/controllerName' after the given namespace; weird...
so it results in something like
Target class [NAMESPACE_GIVEN]\App\Http\Controllers\v1\[CONTROLLER_NAME] does does not exist.
which is
Target class App\Https\Controllers\v1\App\Http\Controllers\v1\[CONTROLLER_NAME] does not exist.
NAMESPACE_GIVEN = App\Https\Controllers\v1
Many Thanks, It was a pleasure to follow you in this tutorial
Thank you for the very efficient course that you have explained in the simplest possible way.
Great course! I've learned a lot from you, thank you. For the bulk insert section, you could consider moving the logic for removing the 'customerId', 'billedDate', and 'paidDate' data from the controller to a protected function called 'passedValidation' in the BulkStoreInvoiceRequest.php . What do you think?
So it would look like this:
protected function passedValidation(){
$data = collect($this->toArray())->map(function($arr, $key){
return Arr::except($arr, ['customerId','billedDate', 'paidDate']);
})->toArray();
$this->merge($data);
}
BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU VERY MUCH!
You are welcome!
Great tutorials for thinking in advanced tips on build stronger API's. One thing, I come from LATAM, so my keyboard too, and my "not equal" symbol that it works is this: '!='
Hi loved the tutorial just one question at 27:00 you said anyone using the API would expect camelcase , but i could stg every single third party API i used even from big companies like (google/facebook etc..) use the same naming conventions as SQL in their responses ( postal_code for example) , so which one is right lol
Great course but i have a question for you: How would you handle filtering on the relationship?
For example, having products with translations but i only want to get the products which have English translations.
I love your voice for learning
tanks for this tuto , i was abel to start my journy with laravel ,thanks a lot
very talented teacher - cheers
Thank you! Cheers!
Thank you , next laravel and vue project please
Great envato tuts team we are waiting for this course premiere ...
Great tutorial, it is really appreciated. What is your reasoning for CamelCase JSON rather than snake_casing? I see some people say it makes things easier for Java/C++/Python. Thoughts?
trust me , this is better even paid course
in my humble opinion, your voice is better than Morgan Freeman
I got everything I needed to know in this one video. Thank you!!
I am following this tutorial now and everything so far is working perfectly well as told in the video. Except for the show function in the controller. When I add /1 to my API Endpoint in PostMan I just get an empty resource. When I remove the /1 I get the entire database. I am not sure why this happens.
EDIT:
A second issue I get it is in the PUT/PATCH section where I get an error in PostMan that says "The PUT method is not supported for route api/v1/registration/validate. Supported methods: GET, HEAD, POST." I did everything like the video said.
I believe that you need to use $request->validated() and not $request->all() in order to retrieve only the data that actually underwent validation.
No it wont work because we put in rules array postalCode field name that will change into postal_code only after the $request->validated(), so you should leave it how it is with all()
Perfect course! Many Thanks
hope this have a frontend react implementation and using this api's
Thank You for this course, Its really helps, More knowledge to your brain bro
What extension for VSC are you using ?
Thank you for this video!
great tutorial, however I found problem in 1:10:51 when using "protection", then changing to "protected"
I love this, havan't come across this kind of tutorial (Very understandable)
Amazing Tutorial , Thank you so much
You are welcome!
May I know why you skipped out on delete request? Finished the course
One of the great video I have seen 💓I loved your voice 💓
Thank you so much 😀
Bad Method Call: Did you mean App\Models\customer::invoice() ?
it gives me this error
Query builder has a when method instead of using if else
could you make a more advanced tutorial this tutorial was really good.I learnt alot
Thanks for the video, very useful course!
I have a small question, at 30:50 in the response results the current_page and last_page are not written in the Camel case, how can I fix this? I understand that Laravel returns this automatically, but I still want to put things in order.
Great course. Is there a GitHub repository for this course?
May I ask if anyone knows the extension? Looks very cool to me
Absolutely love the video, also... love your vscode theme and icon set, could someone let me know what is being used here?
Anyone know if this works on Laravel 9 & PHP 8?
I keep getting 404 on my routes /api/v1/customers ? Thanks
yes it work
Make sure the server is running with "php artisan serve"
This is great content, and has kick started my Laravel. I am trying this with a MongoDB, and am up to the filter. How do I do something like the Filter, but for doing it with MongoDB?
Thank you for explaining this thoroughly!
Glad it was helpful!
Do you have a tutorial that shows how to create a laravel app that consume these api?
i wish my like button turns into 1000 likes button !
what a PRO tutorial
Wow thank you. Great tutorial. A lot of valuable information was given.
Glad it was helpful!
A great tutorial to follow with senior developer tips, this is really excellent! ♥🍻
Glad it was helpful!
Thank you very much, I enjoyed a lot
Wow. this is so easy to understand.
Very good and useful tutorial Thanks!
I have this issue please help: "message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'postalCode' in 'field list' (SQL: insert into `customers`, I did everything but my prepareForValidation() is not working.
sorted
Can you tell me pls how you solved it? I dont know how to solve
@@gieldewinter7068 Actual answer: postalCode in the $fillable array in the Customer model should actually be postal_code.
47:30 . Target class [App\Http\Controllers\Api\V1\Request] does not exist. what is the problem please ?
my working when put this --> use Illuminate\Http\Request; at top of customercontroller.php below it namespace, before the rest of 'use'
try 'composer dump-autoload --optimize' in your terminal.
Amazing course
Loving the course! Just what I needed. May I ask, what VS Code theme are you using?
At 28:20 I had to add an extra '\' for Laravel to create the correct filename and sub-directory...
php artisan make:resource V1\\CustomerResource
Best of the best tutorial
Wonderfull tutorial. I hope this will help many developers. I have one question though. What if you want to save file within post request? I have tried this and got an error. I might doing something wrong when handling the request, but Laravel tools to save file doesn't working at all. If anybody did this I would appreciate if this will be hinted here in comments.
Thank you for the tutorial. I will look out for you other tutorials. Loved it
Not often Lewis Black narrates a Laravel course :)
The api routes didn't work for me. You need to install the API package with the following command...
php artisan install:api
What's more you need to install on a clean project (i.e. immediately after project create).
yes of course, after laravel 11 you need to install api packages
Great course for bro
how about if we have 100 abilities or 100 role to apply to applicaton that we have build, so we must generate 100 token for those abbilities or role every sign in ? and how about make new abilities or role after applicaton running ? add the createtoken to the apps mannualy every time want to add new abilites or role ?
can you detailed the installation step? i think i might skipped few step so its look really different from what you do
Great video, thanks a lot!
I am facing a problem. The problem is when I give a filter parameter in string for example city[eq]=washington, it doesn't give any data but if I give parameter in number for example amount[eq]=3000 then it's working and another problem only lt,gt,eq is working for me, other's don't. How can I remove this problem?. please give me the solution.