Download the PHP package martin6363/laravel-api-auth without Composer

On this page you can find all versions of the php package martin6363/laravel-api-auth. 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 laravel-api-auth

Laravel API Auth

Latest Version on Packagist Total Downloads License

A professional, configuration-driven API authentication package for Laravel 11 & 12+ using Laravel Sanctum. Built with clean architecture principles and designed for easy customization.

โœจ Features

๐Ÿ“‹ Requirements

๐Ÿš€ Installation

Step 1: Install via Composer

Step 2: Install Laravel Sanctum (if not already installed)

Step 3: Install the Package

This command will:

๐Ÿ—‘๏ธ > Uninstallation

If you need to remove the package and all its published components (config, controllers, services, etc.), run:

Step 4 (Optional): Publish Logics (Controllers, Services)

Step 5: Configure Your User Model

Ensure your User model uses the HasApiTokens trait from Laravel Sanctum:

Step 6: Configure Email (Optional)

If you're using email verification or password reset, configure your email settings in .env:

โš™๏ธ Configuration

After installation, you can customize the package behavior by editing config/api-auth.php:

User Model

Token Configuration

Route Configuration

Email Verification

Email Theme Customization

Password Configuration

Rate Limiting

๐Ÿ“ก API Endpoints

Public Endpoints

Register

Response:

Login

Response:

Login Configuration (Dynamic Identification)

Forgot Password

Reset Password

Protected Endpoints (Require Authentication)

All protected endpoints require the Authorization header:

Get Profile

Response:

Refresh Token

Response:

Logout

Response:

Send Email Verification

Verify Email

๐Ÿ”ง Customization

Adding Custom Fields to Registration

You can easily add custom fields to the registration process by adding them to the validation configuration. The package will automatically:

  1. Validate the fields during registration
  2. Save them to the database
  3. Include them in API responses

Example: Adding a phone number field

  1. Update your config/api-auth.php:

  2. Make sure your User model's $fillable array includes the new field:

  3. The field will now be automatically:
    • Validated during registration
    • Saved to the database
    • Included in API responses

Example Registration Request:

Customizing Validation Rules

Edit config/api-auth.php:

Note:

Extending Services

You can extend the services by binding your own implementations in a service provider:

Customizing Routes

You can disable specific routes in the configuration:

Or modify the route prefix:

๐Ÿ›ก๏ธ Security Features

๐Ÿงช Testing

The package includes test examples. Run tests with:

Or with Pest:

Publish Logic

๐Ÿ“ License

This package is open-sourced software licensed under the MIT license.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ง Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

๐Ÿ™ Credits

Built with โค๏ธ for the Laravel community.


All versions of laravel-api-auth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0|^12.0
laravel/sanctum Version ^4.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 martin6363/laravel-api-auth contains the following files

Loading the files please wait ...