Laravel Sanctum Tokens: Customizing Expiration Time for Your API Authentication #laravel #shorts
In this tutorial, we'll be exploring how to easily customize token expiration in Laravel Sanctum. If you're using Laravel Sanctum for API authentication, you might want to adjust the expiration time of the tokens. We'll walk through the steps to do just that! We'll start by exploring the sanctum.php configuration file, then jump into the stateful middleware array, and finally change the value of the expiration key to the desired time (in minutes). With just a few simple changes, you'll be able to set your tokens to expire after the specified amount of time.
📚 New Udemy Course
If you're looking to level up your Laravel skills? My new course "Mastering Laravel 10 Query Builder, Eloquent & Relationships" is the perfect opportunity. Learn the essential tools and techniques for building robust and scalable web applications with Laravel: https://www.udemy.com/course/mastering-laravel-10-query-builder-eloquent-relationships/?referralCode=C784C3DB5B8925207FCB
📲 Let’s plan a meeting
Plan a (paid) 1-hour meeting on Calendly to do portfolio reviews, code reviews resume reviews, or a coaching session for Laravel: https://calendly.com/codewithdary
💌 Newsletter
Sign up for my free weekly email newsletter: https://newsletter.codewithdary.com/
🔥 Resources
- Twitter: https://twitter.com/codewithdary
- Instagram: https://www.instagram.com/codewithdary/
- Blog: https://blog.codewithdary.com/
- Patreon: https://www.patreon.com/user?u=30307830
- GitHub: https://github.com/codewithdary
- TikTok: https://www.tiktok.com/@codewithdary
#laravel #shorts #codewithday