Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lemon_hob's avatar

Laravel Sanctum API authentication for Web & Mobile

im working on this projetct where i need to create a website and a mobile app. im using Laravel API, REACT.js in the front-end, and JAVA/XML for mobile. the problem im facing is how to implement sanctum authentication for both platforms, i can't seem to find any project online for this exact case. note: im fairly new to Laravel. i have create a multi auth system using Laravel Breeze.

0 likes
1 reply
Sergiu17's avatar

https://laracasts.com/series/build-mobile-apps-with-react-native-and-expo - I see you are not subscribed, but Andre there builds an app using react native, and here are the repos

https://github.com/laracasts/lc-rn-twitter-clone -> ReactNative App

https://github.com/laracasts/lc-laravel-twitter-clone -> Laravel Backend

And here's how authentication is handled: https://github.com/laracasts/lc-laravel-twitter-clone/blob/master/app/Http/Controllers/AuthController.php#L38

hope it helps a bit, you may send a XML response with the token, instead of JSON.

1 like

Please or to participate in this conversation.