Download the PHP package altostrat/tools without Composer

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

Altostrat - Laravel Tooling

Installation

Environment Variables

Add the following environment variables to your .env file:

AUTH0_CLIENT_ID should be the client ID of the Altostrat Auth0 tenant application. AUTH0_COOKIE_SECRET should be a random string of at least 32 characters. API_PREFIX should be the prefix for your API routes, e.g. v1/my-service.

Installation Command

Run the following command run through some boilerplate installation steps:

Afterward run the following command to verify that everything is working:


Usage

Authenticated routes

Whenever you want to register a route that requires authentication, add it to the routes/authenticated.php file. This will require the user to be authenticated and have the correct scopes to access the route.

During the installation a model called Customer was created. You can use this model to create relationships with your own models. The Customer model is read-only and only acts as a way to leverage eloquent relationships.

Billable Models

When creating a billable service, commonly a particular model is used to represent the billable item. If you want to make a model billable, simply extend the model from Altostrat\Billable\BillableModel.

The model that you wish to make billable must have a UUID customer_id column and the id column must be a UUID.

Nothing more is needed, when a user attempts to create an item, a check will be performed to see if the user has a valid subscription. If the user is not allowed to create the item, execution will be halted and a response will be returned to the user.

WARNING: When making a model billable, only an authenticated user can create the model. That means it must come in through an authenticated route and the auth()->user() must be set. You cannot create a billable model through a job or a command.

HTTP requests only.

Helpers

The following helpers are available:

Implementation Notes

Remember to ask the infrastructure team to add the prefix to the ALB with these paths:

Service Count Routes

Billable models are automatically made countable.

As an example, if you set the prefix to v1/my-service, the following route will be available:

The model parameter is the name of the model, e.g. my-model. Model names should be converted to kebab-case. E.g. MyModel becomes my-model.

You may optionally pass the count=1 URL parameter to get the count of the model.

If count=1 is not passed, the route will return a list like this:

If count=1 is passed, the route will return a count like this:


All versions of tools with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/console Version ^9.21|^10.0|^11.0|^12.0
illuminate/http Version ^9.21|^10.0|^11.0|^12.0
illuminate/log Version ^9.21|^10.0|^11.0|^12.0
illuminate/routing Version ^9.21|^10.0|^11.0|^12.0
illuminate/support Version ^9.21|^10.0|^11.0|^12.0
auth0/auth0-php Version ^8.7
nyholm/psr7 Version ^1.8
aws/aws-sdk-php Version ^3.269
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 altostrat/tools contains the following files

Loading the files please wait ....