Download the PHP package basecodeoy/laravel-zeus without Composer

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

About Laravel Zeus

This project was created by, and is maintained by Brian Faust, and is a Laravel-compatible API token manager featuring prefix and ability scoping support. Be sure to browse through the security policy.

Design

Laravel Zeus, in terms of design goals, is akin to Laravel Sanctum. It offers a lightweight authentication system for APIs, similar to Sanctum. However, it's important to note that Zeus isn't meant to replace Sanctum, Passport, or Fortify. Instead, it serves as a simpler alternative for developers who don't need the extensive features of the aforementioned systems. Its primary function is to authenticate users using easily identifiable API tokens. This design choice makes it simpler to detect and revoke tokens.

All the access tokens are stored in the access_tokens table and are prefixed at the time of generation. The prefixing helps distinguish the token types, for instance, pat is used for personal access tokens. We employ TypeID to generate these tokens. It creates type-safe, K-sortable, and globally unique API keys. The design is inspired by the system used by Stripe IDs.

Moreover, Laravel Zeus offers the option to restrict tokens to particular abilities and domains. This measure adds another layer of control over their usage. Tokens can also be programmed to expire after a specified duration from their creation. This feature is especially useful for creating short-lived tokens for one-time-use scenarios or long-lived tokens for trusted applications. This auto-expiry function not only enhances security but also enforces regular token rotation, mitigating the risks associated with a permanent token leak.

Installation

Note This package requires PHP 8.2 or later, and it supports Laravel 10 or later.

To get the latest version, simply require the project using Composer:

You can publish the migrations by using:

You can publish the configuration file by using:

Usage

Note Please review the contents of our test suite for detailed usage examples.

The first step to get started is to prepare your model by implementing the HasAccessTokensInterface interface. This can be done by including the HasAccessTokens trait, which provides default implementations for all necessary methods. The process is as follows:

Once you've completed that, you can open your routes/api.php file and replace auth:sanctum with auth:zeus. Everything should work as before, provided you use valid Zeus access tokens.

Now that you've set up your model, you could create a controller to store an access token based on user input, such as providing a name for it. Take a look at the PendingAccessToken class for all available getters and setters. However, in most cases, it's enough to stick to the defaults once you've configured them to match your use case.

If you want to apply rate limiting per access token rather than user ID or IP address, you could achieve this by modifying the API Rate Limiter inside the app/Providers/RouteServiceProvider.php file and specifying the access token as the identifier for rate limiting attempts.


All versions of laravel-zeus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
basecodeoy/laravel-package-powerpack Version ^0.0.1
basecodeoy/typeid Version ^0.0.1
illuminate/contracts Version ^11.0
nesbot/carbon Version ^2.68
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 basecodeoy/laravel-zeus contains the following files

Loading the files please wait ....