Example of Laravel Sanctum with API Tokens

preview_player
Показать описание
I've written a blog article for our QuickAdminPanel, and also decided to shoot a broader demo-video for those who haven't used Laravel Sanctum with API Tokens.

- - - - -
Рекомендации по теме
Комментарии
Автор

It's really weird. Just yesterday I was looking for passport and sanctum, how to use it, and just general information (wanted to use vue components and have a few api endpoints, at the end decided to go with livewire :) ) about it, tried looking at your channel too. And today - wollia! You've got me a video :D Are you spying on my search history? :D Thanks for this video, good job as always.

renasxy
Автор

And don't forget to add throttle in your auth routes. Sanctum doesn't add middleware out of the box like Fortify does.

GraxS
Автор

Thanks for the videos and daily tips on this channel. Just started with Sanctum and this was useful. Has been a great help :)

joshblackwell
Автор

Very good video, explained in a very easy and understandable way.

abelenocrodriguez
Автор

Can't believe you covered that stuff into 5 minutes. Would you do an udemy laravel course, i would instantly buy it

talhasariyuerek
Автор

Can we apply it in multiple authentication using guard. Suppose there are two models User and Customer. For the User, if auth:sanctum middleware is used, then what will be for the Customer?

AnilBaniyaNep
Автор

Simple, easy and well explained ;) thanks

dawizard
Автор

Am using passport and I used the same methodology to return token when user login with even three credentials for my mobile apps (email, mobile number, National ID number) . It works perfectly. And I see nothing is changed. Better to keep my old code.

mro_coding
Автор

How would you store this token in the frontend in a secure way? With jwt you have two tokens with the refresh token stored in a cookie but with sanctum you only have one?

brenol
Автор

can we define those tokens revoking time?
like its only usable for x hours or so?

Benjamin-vxot
Автор

doesnt/didnt laravel provide a basic api_token mechanism since few years ago? works kind of the same and i have used that before, i wonder what the main diff is between that and this..

Shez-dcfn
Автор

Hi .. mine doesn’t show any message like whether its authorized or not .. can you know whats the problem?

nahlaalsayed
Автор

Can I use this method to convert my existing Laravel application routes and share them with the mobile developer? I need to create and share an API with a mobile developer. Or is there any other method for mobile API?

AhsanKhan
Автор

But if i have multiple table like users, customers then if i want to login with customer table also then how to do it?

harinarayan
Автор

Hello, can you make video draggable laravel/vue to-do lists. I try to do, but for whatever reason doesn't work.

bumblebity
Автор

how can we display json resource collection response in blade file laravel?

samiullah
Автор

Hi Povilas, do you have a quick guide to show differences in the files generated by QuickAdminPanel now (for Sanctum) versus previously (for Passport)? I am working on something I generated initially using the Vuejs generator and I'd like to transition it to Sanctum and follow your examples. Also, how do you recommend storing the token on the frontend for a Vue SPA - is local storage ok?

rossco
Автор

Here in this code we have csrf issue how can we prevent that?

bjorn
Автор

How to add prefix in default /login & /register api in laravel sanctum ?

Ex. Default api are /login & /register
I want /api/login & /api/register

How to achieve this?

Also in /user api i am getting many fields like id, name, email, created_date

I just want name and email id
How to do that?

bxrank
Автор

It is possible to display api data into blade

ABHISHEKKUMAR-nerk