sanctum | Laravel Sanctum provides a featherweight authentication | Authentication library

 by   laravel PHP Version: v3.2.5 License: MIT

kandi X-RAY | sanctum Summary

kandi X-RAY | sanctum Summary

sanctum is a PHP library typically used in Security, Authentication applications. sanctum has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.

            kandi-support Support

              sanctum has a medium active ecosystem.
              It has 2533 star(s) with 258 fork(s). There are 47 watchers for this library.
              It had no major release in the last 12 months.
              There are 0 open issues and 253 have been closed. On average issues are closed in 1 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of sanctum is v3.2.5

            kandi-Quality Quality

              sanctum has 0 bugs and 0 code smells.

            kandi-Security Security

              sanctum has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sanctum code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sanctum is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sanctum releases are available to install and integrate.
              sanctum saves you 148 person hours of effort in developing the same functionality from scratch.
              It has 529 lines of code, 64 functions and 20 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sanctum and discovered the below as its top functions. This is intended to give you an instant insight into sanctum implemented functionality, and help decide if they suit your requirements.
            • Set the user as the authenticated user .
            • Bootstrap the application .
            • Get the domain from frontend .
            • Check if an access token is valid
            • Handle the current request .
            • Find a record based on the given token .
            • Register the personal access tokens .
            • Create a new access token .
            • Display action .
            • Return the token array .
            Get all kandi verified functions for this library.

            sanctum Key Features

            No Key Features are available at this moment for sanctum.

            sanctum Examples and Code Snippets

            No Code Snippets are available at this moment for sanctum.

            Community Discussions


            syntax error, unexpected '@', expecting variable (T_VARIABLE) or '{' or '$'
            Asked 2022-Apr-10 at 20:07

            I'am using php 7.4.27, laravel framework 8.83.7 and installed Laravel Jetstream. Login & Register can show. After registered, Then an error notification appears in Laravel: syntax error, unexpected '@', expecting variable (T_VARIABLE) or '{' or '$' and in code line 12 :



            Answered 2022-Apr-10 at 20:07

            The issue comes from the fact that the compiled view version under storage/framework/views is failing to evaluate $@clickPrevent.



            javascript error when downloading pdf file (blob)
            Asked 2022-Mar-30 at 03:00

            I am using this approach for downloading a pdf file from server (laravel 8 (api sanctum) + vue 3)

            In the vue component I have this function that downloads the file



            Answered 2022-Jan-05 at 23:14

            First you need to create a blob and put your response in it,

            And as I said in my comment you don't need to attach to a real anchor tag, you can just create an element, attach it to the body, simulate the click and remove it immediately



            Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" not found on Laravel 9
            Asked 2022-Mar-24 at 14:34

            I just wanted to use Mailgun to send E-mail from my Laravel project and followed this steps from official document:

            composer require symfony/mailgun-mailer symfony/http-client

            When I try to send password reset e-mail to test it, it throws an excepiton:

            Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" not found

            Here is the full stack trace:

            I don't know but maybe it's because this project started as a Laravel 8 project and I updated it to Laravel 9 one week ago. Is it trying to find something comes with Laravel 9 into app directory or something but my project doesn't have that? I didn't understand.

            By the way if it helps; this project uses Jetstream with Inertia.js and Vue.js. So the composer.json looks like this now:



            Answered 2022-Mar-24 at 09:18

            From the upgrade guide:

            To continue using the Mailgun transport, your application should require the symfony/mailgun-mailer and symfony/http-client Composer packages:

            so use:



            Laravel Sanctum login issue
            Asked 2022-Mar-21 at 08:36

            I am using laravel sanctum. I have created a login API and I am getting this error when i am creating Token



            Answered 2022-Mar-21 at 05:35

            the createtoken method requires input parameters. depending on the initial conditions. this is in the error. Like this createToken($request->token_name) Or with abilities



            How to change laravel sanctum return "message": "Unauthenticated."
            Asked 2022-Mar-16 at 15:50

            I have integrated sanctum for API authentication. I was facing a problem of redirection if the token is unauthenticated and solved it using this answer on laracasts

            I could get a JSON response like:



            Answered 2022-Mar-16 at 15:50

            If you check the source code of laravel/sanctum at this line



            laravel8 sanctum "Unauthenticated" when access any route under "auth:sanctum" middleware in server
            Asked 2022-Mar-07 at 15:08

            I'm using sanctum for api, and all api run fine in localhost, but when run api in live server token doesn't work, any route under "auth:sanctum" middleware redirect me to "Unauthenticated", although i loged in, it loged in successfully and generate token, I passed "token" of the user in postman header, although it works fine in localhost, I tried alot of solutions but no way.

            Users model:



            Answered 2022-Mar-07 at 15:08

            The issue was in .haccess, I replaced it from:



            How to limit device login for SPA web app using Laravel Sanctum
            Asked 2022-Feb-26 at 19:49

            I'm building REST API authentication using Laravel sanctum, I wanna make the user can login in multiple device and it is limited by 2 devices, let's say User A and User B are logged in when the user C log in, the user A is logged out and so on. How to achieve this and what is the concept?

            Usually I make a login api when the email and password are correct then return the token.

            I've learned this from netflix which is it has limited device to watch movie.



            Answered 2022-Feb-26 at 19:49

            You can simply check how many tokens you've issued to this user from within your personal_access_tokens table, as shown below:

            So just run such query when you are signing in the user just before issueing a new token for them:



            Sanctum SPA Authentication: How to log out from other devices?
            Asked 2022-Feb-25 at 08:52

            Is this feature included in the SPA Authentication? By reading the docs on Laravel Sanctum, it doesn't look like it, but at the same time, this is a common feature (used if user reset password or if you want only one login instance from a user) so I thought that it must be included...

            After searching, I found this:



            Answered 2022-Feb-25 at 08:52

            Doesn't look like this is included in Laravel Sanctum SPA Authentication. So I just did my original answer found on the youtube video



            Laravel route group and middlewares
            Asked 2022-Feb-24 at 03:32

            i am working on a laravel project with users who can have status verified (email verified).

            on the other hand, users can have a subscription which is verified by a "subscriptions" middleware.

            So I have several groups of routes including 2 of which the only difference is the presence of subscription or not

            group 1:



            Answered 2021-Dec-06 at 12:15

            In app/Http/Kernel.php



            Upgrading laravel into 8 I got illuminate/support support?
            Asked 2022-Feb-15 at 07:54

            I try to upgrade my laravel 8 as I read here

            But after I applyid some changes in composer.json I got error :



            Answered 2022-Feb-15 at 07:54

            Laravel 9 requires PHP 8.

            1. Delete the ^7.3| in composer.json at the line PHPThe correct syntax is: "php": "^8.0"

            2. Delete the v in composer.json at the line laravel/framework, The correct syntax is: "laravel/framework": "^9.0",

            3. And check the package's artesaos/seotools compatibility with the Laravel 9


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install sanctum

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.


            Documentation for Sanctum can be found on the Laravel website.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone laravel/sanctum

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Authentication Libraries


            by supabase


            by google


            by monicahq


            by authelia


            by ory

            Try Top Libraries by laravel


            by laravelPHP


            by laravelPHP


            by laravelPHP


            by laravelPHP


            by laravelPHP