Laravel 8 REST API With Sanctum Authentication

  Рет қаралды 542,266

Traversy Media

Traversy Media

Күн бұрын

Beginner-friendly REST API from scratch using Laravel 8. We will implement authentication using API keys with Laravel Sanctum.
Code:
github.com/bradtraversy/larav...
Laravel Sanctum Docs:
laravel.com/docs/8.x/sanctum
Timestamps:
0:00 - Intro
1:46 - Set Up Laravel
3:23 - SQLite Setup
4:15 - Basic Routing
6:38 - Product Model & Migration
10:56 - Using the Model
14:39 - Product Controller & Methods
17:30 - Create Products & Validation
21:53 - Single Product & Resource Routes
24:05 - Update Product
25:32 - Delete Product
26:54 - Search Products
29:48 - Sanctum Setup
33:22 - Protecting Routes
38:38 - Auth Controller
39:05 - Register User & Get Token
45:30 - Logout & Delete Token
48:00 - Login User & Get Token

Пікірлер: 875
@ruzhdihaxhiu3451
@ruzhdihaxhiu3451 3 жыл бұрын
We all here agree that we need more tuts for Laravel from you Brad.
@CODINGISEASY
@CODINGISEASY 3 жыл бұрын
agree
@bakiuagim
@bakiuagim 3 жыл бұрын
Hajde katundar e loqk, Cmon Raçja 😄
@koffidamanaalexisdidier7144
@koffidamanaalexisdidier7144 2 жыл бұрын
Agree
@rajaroshaan1810
@rajaroshaan1810 2 жыл бұрын
Agreed
@bikourneabdelmoula9082
@bikourneabdelmoula9082 2 жыл бұрын
Agreeeee !!!!
@mouradeljayi584
@mouradeljayi584 3 жыл бұрын
We really need more tutorials about Laravel ! Thank you Brad
@kegklaus5069
@kegklaus5069 3 жыл бұрын
Agreed!
@gomo5628
@gomo5628 3 жыл бұрын
theres old course by Brad on Eduonix, but is about Laravel 6 if I recall good. However I honestly hope, to see up to date course on Laravel by Brad on Udemy, and maybe advanced edition on the OOP PHP MVC Course as well, please :)
@davidfrank-oziwo9836
@davidfrank-oziwo9836 3 жыл бұрын
Agreed!
@patricksantino4131
@patricksantino4131 3 жыл бұрын
His js is also good if not better than his php
@CODINGISEASY
@CODINGISEASY 3 жыл бұрын
I got some
@maazktk2755
@maazktk2755 3 жыл бұрын
Waiting so long for your own laravel content. Thank you so much 😍
@code_magpie
@code_magpie 2 жыл бұрын
You and Mosh are the greatest code Instructors on KZfaq who make very difficult and blurry things very simple and crystal clear. Love the way you teach. You aren't wasting a single minute in unrelated things. Whenever you bring something, you always come up with something solid.
@stefans1066
@stefans1066 3 жыл бұрын
Awesome content and I think it is very likeable that you don't try to cover up or cut out any mistakes / typos etc. because that keeps it so authentic. Thanks for the effort man, much appreciated 👍
@michealgabriel1437
@michealgabriel1437 2 жыл бұрын
Oh my, I really love the way you taught this... simple, straight forward, organized and calm. Amazing Thanks Brad !
@santysasa12
@santysasa12 2 жыл бұрын
Great teacher! You go straight to the point, you explain in a easy way to understand, you take your time to explain the details of what you are doing. Keep up the good work! Edit: I found the video, and thought this was your channel. I don't know if you have a channel of your own already, explaining code, laravel or other stuff, but you really should.
@armindamarin3328
@armindamarin3328 3 жыл бұрын
Thank you very much, Brad, for this video and for others such as javascript, react and react-native. Those have been the ones I've watched and I really like your teaching style and the pacing of the videos. Thanks to you I might actually pass my internship yet :D
@frankjones7119
@frankjones7119 2 жыл бұрын
Give this guy a medal! Thanks a lot Brad. Your videos are incredibly helpful. I just wish I could ask you some questions as I watch. Thankfully, you explain things well enough for me to just pause the vid, go research and come back with the knowledge I need. Keep up the good work man!
@s-sugoi835
@s-sugoi835 2 жыл бұрын
Hands down, the only tutorial that worked out for me. It was laughing so hard towards the end but I learned a lot from this. More power to you Brad!
@shivansh901
@shivansh901 3 жыл бұрын
Mr Traversy is one of the best teacher, explaining each and every line of code makes learning so much easier. Thanks for such quality content.
@gamedevsa
@gamedevsa 3 жыл бұрын
I cannot believe that you record these tutorial in real time and pretty much perfect. Anyone that has tried this knows how impressive that is. Thanks.
@jareerzeenam8200
@jareerzeenam8200 3 жыл бұрын
Omg, Thank you so much Brad. Your Previous Laravel video (lsapp) was my first ever laravel course in my life and it changed a lot in my life. Now i'm working as a Laravel Backend developer in a reputed company. Thank you so much again. You have been a role model in my life ❤️
@amehjosephonyeke9115
@amehjosephonyeke9115 9 ай бұрын
what is his full name please, he did not even mention it at the beginning of the tutorial
@SiddharthBhansali
@SiddharthBhansali 3 жыл бұрын
Doesn't matter how many channels I go through, in the end Brad's videos are the ones I understand the best. Thank you, great video!
@integralproject4775
@integralproject4775 3 жыл бұрын
I do agree with others, Laravel tutorials are really needed. Thank you very much Brad.... You are helping us in a way that is not possible to say it by words. You are a HERO in our hearts BRAD. I LOVE YOUR WORK
@nivus97
@nivus97 3 жыл бұрын
Eres realmente muy bueno, te felicito, preciso y puntual, sin duda alguna debería haber mas tutoriales como los tuyos. Además lo explicas de una manera muy buena para poder despegar un proyecto base, saludos desde México.
@BruceMcGivern
@BruceMcGivern Жыл бұрын
Seriously the quality of your content is beyond insane. I have not gotten this level of education during my whole time on the university. How the possibility of learning something new has improved within the last 15 years... It always blows my mind.
@Kader-su8jr
@Kader-su8jr 3 жыл бұрын
This is exactly what i wanted😮 and boom I got a Traversy Media video🔥
@Andbil
@Andbil 3 жыл бұрын
You must have missed his video on machine learning to predict user demands for video platforms ;)
@wojciechmruk3539
@wojciechmruk3539 3 жыл бұрын
Same here. I've just finished API on Lumen but it's always good to check Traversy :)
@MULTICODE
@MULTICODE 3 жыл бұрын
@@wojciechmruk3539 links please
@bra5081
@bra5081 3 жыл бұрын
Me too lol
@wojciechmruk3539
@wojciechmruk3539 3 жыл бұрын
@@MULTICODE That's an internal project for the company :/ I can't share.
@drjonbear7517
@drjonbear7517 3 жыл бұрын
I just want to put it out there that today I was tasked with creating a REST API in Laravel. Never done it before. Exquisite timing as usual!
@Anothy
@Anothy 2 жыл бұрын
Awesome tutorial, dude! I went from having never touched Laravel to being confident enough to make an API with authentication.
@ush6939
@ush6939 3 жыл бұрын
bro this is so insane , i started watching ur 2019 or 2018 laravel series , im on part 9 right now i was willing to watch some other tutoriels after i was finished with yours and now boom u put a laravel video out of nowhere , thank you so much for your time
@ilhamakhyar4849
@ilhamakhyar4849 Жыл бұрын
Compared to other tutorials, I think this is the only tutorial that is simple and very clear. Thank you so much brad
@mirodil.kamilov
@mirodil.kamilov 3 жыл бұрын
After learning most of the basics of Laravel, I have recently started thinking about APIs (which is not so much content indeed). So, it was right to time with the right context for me. Thank you, Brad!
@marcolancellotti8114
@marcolancellotti8114 3 жыл бұрын
Just a little tip! In the video Brad uses the resource to handle CRUD apis in both Controller generation and Routing but there is actually a better method: using the apiResource instead of resource will not generate the routes and methods for the view parts which in API case are pretty uselless :)
@JavedURRehman
@JavedURRehman 8 ай бұрын
Brad, I always learn something good and new whenever I watch your tutorials in the easiest and simple way. Thanks
@chiar995
@chiar995 3 жыл бұрын
yesterday I was checking the channel for laravel projects, what a great time!
@djaouidakharchi4024
@djaouidakharchi4024 2 жыл бұрын
I learned more in an hour than a month at my actual school. Thank you Brad.
@qofi_1
@qofi_1 3 жыл бұрын
I have been thinking about this for a few days now. This guy can read minds. Thanks man
@amebleyk6189
@amebleyk6189 Жыл бұрын
This is ALL the video I NEEDED to get started! I owe you a lot, Brad!!
@maksymdudyk1718
@maksymdudyk1718 3 жыл бұрын
Awesome, Brad. I admire your magic ability to publish tuts on hot topics.
@mounirmoutawakil1078
@mounirmoutawakil1078 3 жыл бұрын
finally some laravel stuff !
@kalombograce2677
@kalombograce2677 3 жыл бұрын
I have been waiting for it, since I watched your "10 projects with Laravel back in the days on Eduonix". Thanks
@StefanPopi
@StefanPopi 3 жыл бұрын
Thank you for the hard work put into this video. A tutorial with a FrontEnd connected to this API would be really useful.
@FunctionGermany
@FunctionGermany 3 жыл бұрын
you saved my life, this is exactly what i need for my software engineering final exam project ♥ i couldn't figure out how to do custom auth + SPA/API in laravel before i watched this. THANK YOU SO MUCH!
@liteninkiran
@liteninkiran 2 жыл бұрын
This is a really good course. I always love Brad's courses and this is another great one.
@Vasmir5
@Vasmir5 3 жыл бұрын
If possible please make a react front end for Laravel. This is a nice combination that is not seen often. Naturally, thank you for for all the videos you provide. They are immense help.
@majacom2
@majacom2 Жыл бұрын
Agreed! Front-end react + redux (with TypeScript offcourse) and back-end: Laravel and whatever db. By the way thx a lot Brad! Your content is life changer for me.
@chzmo
@chzmo Жыл бұрын
This would be cool
@checkoverstripes1464
@checkoverstripes1464 Жыл бұрын
MLR Stack (MongoDB Laravel React)
@yaseenlakhdhar6090
@yaseenlakhdhar6090 3 жыл бұрын
Legend
@dahsin9812
@dahsin9812 3 жыл бұрын
You uploading so many new vids, that now I wanna learn everything!! My man!!
@bkcauafroes2012
@bkcauafroes2012 Жыл бұрын
this is one of the best laravel tuts i ever watched dude, congrats!!
@LoveLiveAndCode
@LoveLiveAndCode 3 жыл бұрын
Its Been So long since your first PHP Laravel Tuts... Thanks Alot Brad
@fahimanzam7015
@fahimanzam7015 3 жыл бұрын
Finally Laravel from you. Need a complete advance course.
@bikourneabdelmoula9082
@bikourneabdelmoula9082 2 жыл бұрын
i really like the way you make things look easy ! You're the best Brad ! Keep going !
@sayeedmahmudsaad7535
@sayeedmahmudsaad7535 3 жыл бұрын
I was searching to set the unique token authentication for 6 months now I found Brads video. That was really helpful. I request you to make a quick crash course on Laravel 8. I saw your previous series but it's not updated. So, Hopefully We'll get the latest laravel tutorial series from you. Thanks for everything you give us.
@AndrewPaget
@AndrewPaget Жыл бұрын
I love these tutorials. Always easy to watch, follow and understand. Thanks Brad. Oh, and I agree with the previous comment...more 🙂
@GarronArgentina
@GarronArgentina 3 жыл бұрын
I am happy to see you again rolling making videos!! welcome back!
@nikulasoskarsson5472
@nikulasoskarsson5472 3 жыл бұрын
Really happy seeing this one! Do you have any plans to do more Laravel / PHP soon Brad? :)
@Doomslayer420
@Doomslayer420 3 жыл бұрын
Another Legendary Lesson From A Legendary Teacher ❤️
@behzodjon
@behzodjon 3 жыл бұрын
Finally! Laravel!! We've been waiting so long!!!!!!!!!!!!! Please , make videos about Laravel more!!!!!!!!!!!!!
@fadifindakly3657
@fadifindakly3657 3 жыл бұрын
Another great tutorial by Brad! I can't say thank you enough!
@zaidh41
@zaidh41 3 жыл бұрын
hey, brad loves your work and your tutorials help me a lot in my development carrier. please do a full website development course using laravel and please let us know when you are planning to live your nextjs course
@josephizz4877
@josephizz4877 Жыл бұрын
I quit watching your videos online, now i only give it a like then download it, so that i can go back an forth, and get the whole value. Just finshed laravel crash course yesterday, and i really appreciate what you are giving us *for free*, brad is truly a valuable resource.
@kewilol
@kewilol 5 ай бұрын
Very helpful in understanding Laravel auth sanctum! Thank you so much Brad!
@SimDiok
@SimDiok 3 жыл бұрын
so glad to finally see my virtual mentor! thanks Brad!
@darrennienaber6488
@darrennienaber6488 2 жыл бұрын
Hey Brad, just got started on Laravel, this was awesome! Thank you.
@theoboldalex
@theoboldalex 3 жыл бұрын
This is the video I've been waiting for!!! Thanks Brad!
@rimialfarwan2397
@rimialfarwan2397 3 жыл бұрын
Thank you so much Brad, you are always amazing!. just a side note, we can use Route::apiResource instead of Route::resource in the route. also if you type hint the parameters in the update/delete methods with the model class, Eloquent will automatically fetch the object for you ;)
@MG-wx8yx
@MG-wx8yx 2 жыл бұрын
He is not using resource class I think that's why he didn't use Route::apiResource(), I guess that's the reason. I always use resource class and then use apiResource in all my route resources in api.php file.
@zeryez6347
@zeryez6347 2 жыл бұрын
Really Great Video had no idea at all about php and Laravel but thanks to you I feel little more safe around this language now and you're the first guy I really enjoyed listening to 1h without wanting to stop the video thank you very very much. Keep up the good work you're doing a great job
@yiyoascen
@yiyoascen 2 жыл бұрын
your content ALWAYS helps. You're a great guy Traversy Media
@bra5081
@bra5081 3 жыл бұрын
I like this kind of tutorial, simple, efficient, straight to the point and practical.
@abderrahimlahyani3093
@abderrahimlahyani3093 3 жыл бұрын
A Laravel tutorial with Microservices Architecture would be greaaaat!!! Thank you!
@joshuajackson8973
@joshuajackson8973 2 жыл бұрын
Just create several apis that split down the domain content
@gmfer9604
@gmfer9604 2 жыл бұрын
Excellent video, helped me a lot to understand quickly about Sanctum API and got my development running in no time.
@SausosiosIsrugos
@SausosiosIsrugos 3 жыл бұрын
Thank you! A follow up with REACT would be amazing
@Bjokac
@Bjokac 2 жыл бұрын
This tutorial is of excellent quality and has guided a fellow student and myself on our first steps with laravel's authentication. Thank you very much.
@user-dk2cn2hz7n
@user-dk2cn2hz7n 3 жыл бұрын
As always, it is very easy to understand. Thanks Brad. Health to you man.
@rdwanbzzaze1813
@rdwanbzzaze1813 2 жыл бұрын
thank you very much We really need more tutorials about Laravel ! Thank you Brad
@AmeenAltajer
@AmeenAltajer 3 жыл бұрын
Extremely helpful! Thanks Brad!
@gersonpascua1196
@gersonpascua1196 2 жыл бұрын
Thanks Brad. I've been a web developer for two years now because of your tutorials. Thanks cheers...
@arifmammadov5588
@arifmammadov5588 3 жыл бұрын
Every time you read my mind and publish the tutorial that I need. Huge thanks and respect to you :)
@irenejenna5725
@irenejenna5725 2 жыл бұрын
I got an interview for a API developer job next week, the company's stack is Laravel. This is the most useful video I have seen in a long time. Thank you so much
@Peter-ue4iz
@Peter-ue4iz Жыл бұрын
did you get the job? if not, I have more work for you and looking for a laravel expert to build an API.
@irenejenna5725
@irenejenna5725 Жыл бұрын
@@Peter-ue4iz I didn't get that job, but I got an offer from another company.
@tusharmalik7949
@tusharmalik7949 3 жыл бұрын
Man , u r perfect to explain everything crystal clear
@moh.dah.familay
@moh.dah.familay Жыл бұрын
Thank you very much .. You are a great teacher and your way of explaining is amazing. I have been researching this topic for more than 4 months, and I only understood it through you. Thank you very much 🤩
@michaelibezim8486
@michaelibezim8486 Жыл бұрын
Just finished another great topic from brad, you are soo helpful
@aris.konstantinidis
@aris.konstantinidis 3 ай бұрын
Thank you so much for your content. You have been such a great inspiration for me. I still remember the first video I saw from you on how to deploy a simple node.js app. Now, 3 dev jobs and on cs degree later, I still come back to your channel for tips and tricks! :) keep on!
@inbaljona6539
@inbaljona6539 Жыл бұрын
I just watched your tutorial and it really helped me understand Laravel. Thank you for sharing your knowledge!
@pongpitisripolpaew6979
@pongpitisripolpaew6979 2 жыл бұрын
Love your training videos. Thank you so much Brad from Thailand!
@TheChiaralyn
@TheChiaralyn 3 жыл бұрын
First Like
@__kawaii
@__kawaii 2 жыл бұрын
This is best Laravel tutorial channel. Thank you so much. You're just genius..
@daniellaerachannel
@daniellaerachannel 3 жыл бұрын
first Mr Traversy! you're a legend!
@seyyedmahdikhalifeloo7283
@seyyedmahdikhalifeloo7283 3 жыл бұрын
It's always nice to see your videos, specially when you are there at the corner!:) Stay safe!
@jaker9007
@jaker9007 Жыл бұрын
Very accessible tutorial on token-based authentication. Thank you!
@raulemilianomirandagutierr3313
@raulemilianomirandagutierr3313 3 жыл бұрын
I've been looking for a video like this for a month, thanks!
@chrisli3179
@chrisli3179 2 жыл бұрын
Hey Calvin, me again! Was just rewatching some of your videos, man you have a lot of awesome content. I mean, I can tell you know your stuff and you want to show something more advanced that the general Laravel API beginners stuff, so people can see how a more advanced implementation works. Definitely appreciate that... I have a specific comment here, because i was trying your "public static $wrap = 'articles';", but it didn't work in the ArticleResources file. I looked for an answer and saw some implementations put it into ArticleCollection... so i moved it there and it worked for me.
@mubassirahmedturjo9911
@mubassirahmedturjo9911 2 жыл бұрын
Brad Traversy you are one hell of a person
@olamidejubril9913
@olamidejubril9913 3 жыл бұрын
Mr Brad, Thank you much for all this wonderful video tutorials, God bless you effort.
@risteltechnologies7778
@risteltechnologies7778 3 жыл бұрын
The way u explained the things is just awesome....
@indulekha1352
@indulekha1352 Жыл бұрын
This is awesome. Short, sweet and definitely very useful. Thanks a lot
@AdityaPrakarsa
@AdityaPrakarsa 3 жыл бұрын
Thanks Brad, as always great video. Would be great if you could do front end stuff with reactjs to continue this video..
@bogdanlupu3679
@bogdanlupu3679 3 жыл бұрын
Thank you Brad. I like laravel. The truth is I have a project ongoing and this helps me a lot (as always your tuts ar short and point on. No side chit chat) .
@isaackash2401
@isaackash2401 2 жыл бұрын
It was so wonderful and clear for me. Thanks Brad!
@gilangrama7039
@gilangrama7039 3 жыл бұрын
This is exactly why I need it right now for my college task.
@dev9033
@dev9033 3 жыл бұрын
semang cuk
@GGSoft2009
@GGSoft2009 2 жыл бұрын
Always excellent tutorials from you. That's why I love this channel. A special thanks for the large screen view. Please make a crash course about the .htaccess file commands.
@wkolcz
@wkolcz 2 жыл бұрын
Thank you Brad! This helped a ton with my current projects!
@syntaxerron4333
@syntaxerron4333 3 жыл бұрын
Thank you sir BRad for this. More Laravel Tutorials please.
@perthDev
@perthDev 3 жыл бұрын
Quality content. Looking forward to more Laravel SPA tutorials from you.
@cromero2386
@cromero2386 3 жыл бұрын
This is exactly I need. Thanks brads
@UTravis
@UTravis 2 жыл бұрын
Thanks a lot Traversy Media, this video was truly insightful
@irfankhanmohammed6964
@irfankhanmohammed6964 3 жыл бұрын
I always open your videos for your introduction part. I like it so much.
@mauro21523
@mauro21523 2 жыл бұрын
Thank you Brad, It was very helpful for my comprehension with Laravel development!
@janzenfaidiban
@janzenfaidiban 2 жыл бұрын
I always love the way you give the explanation. Thanks for the tutorial
@PHPTechLife
@PHPTechLife 6 ай бұрын
Your teaching style is amazing.
@harisnoori6612
@harisnoori6612 2 жыл бұрын
Thanks, Learned the Laravel APIs in one single video,!
Vue JS Crash Course
1:50:52
Traversy Media
Рет қаралды 1,3 МЛН
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 3,9 МЛН
Children deceived dad #comedy
00:19
yuzvikii_family
Рет қаралды 6 МЛН
OMG😳 #tiktok #shorts #potapova_blog
00:58
Potapova_blog
Рет қаралды 3,9 МЛН
The Importance of Specialization in Coding
7:13
Traversy Media
Рет қаралды 186 М.
Laravel SPA Authentication - setup and common mistakes
16:55
Laravel 11 API in 13 minutes | Sanctum
13:49
WebDevWithArtisan
Рет қаралды 10 М.
NextJS and Laravel Can Be Friends
23:54
Laravel
Рет қаралды 17 М.
Laravel CRUD in 50 minutes for Beginners  from Scratch
49:58
Devtamin
Рет қаралды 183 М.
Аутентификация запросов к API в Laravel | Laravel Api Authenticate
17:17
Lectoria. Обучение веб-разработке.
Рет қаралды 14 М.
Laravel Sanctum SPA Tutorial - React SPA Authentication With Sanctum
14:27
Laravel API with Sanctum and Breeze in 60 mins | Crash course
1:02:26
WebDevWithArtisan
Рет қаралды 12 М.
Cadiz smart lock official account unlocks the aesthetics of returning home
0:30
Best mobile of all time💥🗿 [Troll Face]
0:24
Special SHNTY 2.0
Рет қаралды 1 МЛН
Low Price Best 👌 China Mobile 📱
0:42
Tech Official
Рет қаралды 717 М.