Download the PHP package daniel-de-wit/lighthouse-sanctum without Composer

On this page you can find all versions of the php package daniel-de-wit/lighthouse-sanctum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lighthouse-sanctum

Lighthouse Sanctum

GitHub Tests Action Status Coverage Status PHPStan Latest Version on Packagist Total Downloads

Add Laravel Sanctum support to Lighthouse

Requirements

Installation

1. Install using composer:

2. Publish configuration and schema

3. Import the published schema into your main GraphQL schema (./graphql/schema.graphql)

4. HasApiTokens

Apply the Laravel\Sanctum\HasApiTokens trait to your Authenticatable model as described in the Laravel Sanctum documentation.

5. Configuration

This package relies on API Token Authentication, which uses stateless Bearer tokens to authenticate requests.

By default, Laravel Sanctum assumes that requests made from localhost should use the stateful Spa Authentication instead. To disable this behaviour, remove any lines within the stateful section of your sanctum configuration:

Make sure the following middleware is enabled for Lighthouse:

Configure Lighthouse to use the Sanctum guard:

Usage

Login

Authenticate the user to receive a Bearer token.

Apply the Authorization header on subsequent calls using the token

(Using something other than email? See Custom Identification)

Logout

Revoke the current token.

Register

Successfully registering a user will immediately yield a bearer token (unless email verification is required).

:point_up: Want to disable password confirmation? Update your schema

When registering a user in combination with the MustVerifyEmail contract you can optionally define the url for email verification. Both __ID__ and __HASH__ will be replaced with the proper values. When use_signed_email_verification_url is enabled in the configuration, the placeholders __EXPIRES__ and __SIGNATURE__ will be replaced.

Email Verification

The verification_url provided at register or resendEmailVerification contains the id and hash for the mutation:

When use_signed_email_verification_url is enabled in the configuration, the input requires two additional fields.

Resend Email Verification Link

Use default Laravel email verification notification.

Or use the custom verification flow by uncommenting the verification_url argument within the ResendEmailVerificationInput:

Example mutation:

Forgot Password

Sends a reset password notification.

Optionally use custom reset url using both __EMAIL__ and __TOKEN__ placeholders.

Reset Password

Reset the user's password.

:point_up: Want to disable password confirmation? Update your schema

Update Password

Updates the current user's password.

Custom Identification

You can customize which fields are used for authenticating users.

For example, using username instead of the default email.

Update the GraphQL schema accordingly

Docker

Develop locally using Docker & Docker Compose.

Setup

This will build the Docker image and prepare the container.

CLI

Enter the container with shell to start developing.

Destroy

Shutdown and remove the container.

Testing

Coverage

Static Analysis

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of lighthouse-sanctum with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/auth Version ^9 || ^10 || ^11
illuminate/contracts Version ^9 || ^10 || ^11
illuminate/database Version ^9 || ^10 || ^11
illuminate/routing Version ^9 || ^10 || ^11
illuminate/support Version ^9 || ^10 || ^11
laravel/sanctum Version ^3.0 || ^4.0
nuwave/lighthouse Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daniel-de-wit/lighthouse-sanctum contains the following files

Loading the files please wait ....