Download the PHP package kirschbaum-development/laravel-preflight-checks without Composer

On this page you can find all versions of the php package kirschbaum-development/laravel-preflight-checks. 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-preflight-checks

Laravel Preflight Checks

Laravel Supported Versions

Performs pre-flight checks to ensure configuration and setup for deployment or development.

This package is particularly useful for automated deployments where configuration is managed separately (such as containerized deployments via Docker, K8s, etc). It can also be used as a go/no-go check for setting up local and/or dev environments.

Installation

You can install the package via composer:

Setup

After requiring the composer package, publish the config file

Configure the config/preflight_checks.php file with the configuration necessary for your app. Some defaults are provided (commented out) based on typical environments.

The config file is structured like so: 'checks' > environment name > array of checks

Every check can be specified with options, for example:

Or with the fully explicit syntax:

If you need to repeat checks (for example, when using multiple database connections), you will need to use the full syntax.

Available Checks

Database

Kirschbaum\PreflightChecks\Checks\Database

Checks that the database connection can be established, via the PDO, and that the required config keys are set. It outputs some server info and version information.

Option Description
connection The name of the connection in config/database.php

Redis

Kirschbaum\PreflightChecks\Checks\Redis

Checks that Redis connection can be established, and that the required config keys are set.

Option Description
connection The name of the connection in config/database.php )

Configuration

Kirschbaum\PreflightChecks\Checks\Configuration

Checks that the specified config keys are set. This checks the config values, NOT the env values to ensure that in higher environments the correct detection is taking place. As such, make sure to specify the same keys you'd use for config(...).

The accepted options for the Configuration preflight check is a list of config keys to check. For example:

You may also pass a hint (recommended for local development only) that will be shown if the key is not set. For example:

When a new dev sets up their environment and is missing that config value, they will get that nice friendly message helping them find the key.

You can also specify optional config values and provide a hint as well with the OptionalConfiguration class, which operates the same way, but does not cause the command to fail.

Write Your Own!

If you have a special startup consideration you'd like to make, feel free write your own check, extending Kirschbaum\PreflightChecks\Checks\PreflightCheck.

Specify any necessary config keys on the $requiredConfig property.

Implement the check method, which should perform your check and mark the $result as pass/fail.

Example:

Usage

Basic usage is via the Artisan command:

If you would like to see the info on successful checks (not just the failures), add a verbose flag -v.

You may test other environment by specifying the artisan environment (--env).

For higher and/or automated environments (such as CI/CD), you may want to use the --show-only-failures flag to cut down on noise.

Kubernetes

In Kubernetes deployments, this can be used in a startup probe (1.20+):

You could also set this up for a readiness probe, but keep in mind that probe is still run throughout the entire lifecycle of the container (we are establishing connections to Redis or the DB, which are not insignificant to consider).

Containerized Environments

In containerized environments (including K8s), you may want to "block" container startup (e.g. php-fpm) with this command, to ensure the correct environment was loaded and cached properly. For the standard php-fpm docker container, you can use a startup script such as:

Local Environment

The preflight:check command can also provide a concrete method of assuring all the appropriate environment configuration has taken place. This can be especially helpful when bringing on new developers, as simply running php artisan preflight:check can give them a good indication of what's left to setup/configure before their environment is live.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] or [email protected] instead of using the issue tracker.

Credits

Sponsorship

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more about us or join us!

License

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


All versions of laravel-preflight-checks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
illuminate/pipeline Version ^8.0|^9.0|^10.0|^11.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 kirschbaum-development/laravel-preflight-checks contains the following files

Loading the files please wait ....