Perform Self-Diagnosis Tests On Your Laravel Application

Last update: May 22, 2022

Perform Self-Diagnosis Tests On Your Laravel Application

Latest Version on Packagist Build Status Quality Score Total Downloads

This package allows you to run self-diagnosis tests on your Laravel application. It comes with multiple checks out of the box and allows you to add custom checks yourself.

Here is an example output of the command:

All Checks passed

Included checks

  • Is the APP_KEY set?
  • Are your composer dependencies up to date with the composer.lock file?
  • Do you have the correct PHP version installed?
  • Do you have the correct PHP extensions installed?
  • Can a connection to the database be established?
  • Do the storage and bootstrap/cache directories have the correct permissions?
  • Does the .env file exist?
  • Is the maintenance mode disabled?
  • Are the required locales installed on the system?
  • Are there environment variables that exist in .env.example but not in .env?
  • Are there any migrations that need to be run?
  • Is the storage directory linked?
  • Can Redis be accessed?

Development environment checks

  • Is the configuration not cached?
  • Are the routes not cached?
  • Are there environment variables that exist in .env but not in .env.example?

Production environment checks

  • Is the configuration cached?
  • Are the routes cached?
  • Is the xdebug PHP extension disabled?
  • Is APP_DEBUG set to false?
  • Are certain servers reachable?
  • Are certain supervisor programs running?

Installation

You can install the package via composer:

composer require beyondcode/laravel-self-diagnosis

If you're using Laravel 5.5+ the SelfDiagnosisServiceProvider will be automatically registered for you.

Usage

Just call the artisan command to start the checks:

php artisan self-diagnosis

Customization

You can publish the configuration file, that contains all available checks using:

php artisan vendor:publish --provider=BeyondCode\\SelfDiagnosis\\SelfDiagnosisServiceProvider

This will publish a self-diagnosis.php file in your config folder. This file contains all the checks that will be performed on your application.

<?php

return [

    /*
     * A list of environment aliases mapped to the actual environment configuration.
     */
    'environment_aliases' => [
        'prod' => 'production',
        'live' => 'production',
        'local' => 'development',
    ],

    /*
     * Common checks that will be performed on all environments.
     */
    'checks' => [
        \BeyondCode\SelfDiagnosis\Checks\AppKeyIsSet::class,
        \BeyondCode\SelfDiagnosis\Checks\CorrectPhpVersionIsInstalled::class,
        \BeyondCode\SelfDiagnosis\Checks\DatabaseCanBeAccessed::class => [
            'default_connection' => true,
            'connections' => [],
        ],
        \BeyondCode\SelfDiagnosis\Checks\DirectoriesHaveCorrectPermissions::class => [
            'directories' => [
                storage_path(),
                base_path('bootstrap/cache'),
            ],
        ],
        \BeyondCode\SelfDiagnosis\Checks\EnvFileExists::class,
        \BeyondCode\SelfDiagnosis\Checks\ExampleEnvironmentVariablesAreSet::class,
        \BeyondCode\SelfDiagnosis\Checks\LocalesAreInstalled::class => [
            'required_locales' => [
                'en_US',
                'en_US.utf8',
            ],
        ],
        \BeyondCode\SelfDiagnosis\Checks\MaintenanceModeNotEnabled::class,
        \BeyondCode\SelfDiagnosis\Checks\MigrationsAreUpToDate::class,
        \BeyondCode\SelfDiagnosis\Checks\PhpExtensionsAreInstalled::class => [
            'extensions' => [
                'openssl',
                'PDO',
                'mbstring',
                'tokenizer',
                'xml',
                'ctype',
                'json',
            ],
            'include_composer_extensions' => true,
        ],
        \BeyondCode\SelfDiagnosis\Checks\StorageDirectoryIsLinked::class,
    ],

    /*
     * Environment specific checks that will only be performed for the corresponding environment.
     */
    'environment_checks' => [
        'development' => [
            \BeyondCode\SelfDiagnosis\Checks\ComposerWithDevDependenciesIsUpToDate::class => [
                'additional_options' => '--ignore-platform-reqs',
            ],
            \BeyondCode\SelfDiagnosis\Checks\ConfigurationIsNotCached::class,
            \BeyondCode\SelfDiagnosis\Checks\RoutesAreNotCached::class,
        ],
        'production' => [
            \BeyondCode\SelfDiagnosis\Checks\ComposerWithoutDevDependenciesIsUpToDate::class => [
                'additional_options' => '--ignore-platform-reqs',
            ],
            \BeyondCode\SelfDiagnosis\Checks\ConfigurationIsCached::class,
            \BeyondCode\SelfDiagnosis\Checks\DebugModeIsNotEnabled::class,
            \BeyondCode\SelfDiagnosis\Checks\PhpExtensionsAreDisabled::class => [
                'extensions' => [
                    'xdebug',
                ],
            ],
            \BeyondCode\SelfDiagnosis\Checks\RedisCanBeAccessed::class => [
                'default_connection' => true,
                'connections' => [],
            ],
            \BeyondCode\SelfDiagnosis\Checks\RoutesAreCached::class,
            \BeyondCode\SelfDiagnosis\Checks\ServersArePingable::class => [
                'servers' => [
                    'www.google.com',
                    ['host' => 'www.google.com', 'port' => 8080],
                    '8.8.8.8',
                    ['host' => '8.8.8.8', 'port' => 8080, 'timeout' => 5],
                ],
            ],
            \BeyondCode\SelfDiagnosis\Checks\SupervisorProgramsAreRunning::class => [
                'programs' => [
                    'horizon',
                ],
                'restarted_within' => 300, // max seconds since last restart, 0 to disable check
            ],
        ],
    ],

];

Available Configuration Options

The following options are available for the individual checks:

Custom Checks

You can create custom checks, by implementing the BeyondCode\SelfDiagnosis\Checks\Check interface and adding the class to the config file. Like this:

<?php

use BeyondCode\SelfDiagnosis\Checks\Check;

class MyCustomCheck implements Check
{
    /**
     * The name of the check.
     *
     * @param array $config
     * @return string
     */
    public function name(array $config): string
    {
        return 'My custom check.';
    }

    /**
     * Perform the actual verification of this check.
     *
     * @param array $config
     * @return bool
     */
    public function check(array $config): bool
    {
        return true;
    }

    /**
     * The error message to display in case the check does not pass.
     *
     * @param array $config
     * @return string
     */
    public function message(array $config): string
    {
        return 'This is the error message that users see if "check" returns false.';
    }
}

Example Output

Some Checks failed

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

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

GitHub

https://github.com/beyondcode/laravel-self-diagnosis
Comments
  • 1. Structure tests

    After #39 I have been thinking about structuring the tests. In this PR are new test, structure changes and small changes in checks to prevent failures.

    What I have done:

    • Move the test to corresponding directories, in fact move all the test for checks to tests/Checks
    • Ignore the phpunit.xml in .gitignore, there is already a phpunit.xml.dist and the phpunit.xml is only to overwrite that file so I suspect it can be safely ignored.
    • Edit the DirectoriesHaveCorrectPermissions, ExampleEnvironmentVariablesAreSet, ExampleEnvironmentVariablesAreUpToDate, LocalesAreInstalled and ServersArePingable check so you don't get an error if you call the message function before the check function on that classes. (Normally that shouldn't happen but it isn't forced so I think it is good to prevent any error)
    • Change a mock result in StorageDirectoryIsLinkedTest to match the real result.
    • Add tests for the next checks:
      • ComposerWithDevDependenciesIsUpToDate
      • ComposerWithoutDevDependenciesIsUpToDate
      • ConfigurationIsCached
      • ConfigurationIsNotCached
      • DebugModeIsNotEnabled
      • MaintenanceModeNotEnabled
      • RoutesAreCached
      • RoutesAreNotCached
    • Add test for the message and name functions on already existing tests
    • Add @group annotations to the tess

    Some questions I have:

    • It is possible to use a trait in the test for the message and name function test of the most checks. I didn't do it to make it clear and readable. Is that good or is the use of a trait wanted?
    • Is it wanted that I add a message to the assertInternalType calls for the message and name checks? Now I just be sure that it is working without any problem.
    • I added the group checks to the tests for the checks and also groups for connected tests (Like @group routes ) Is this wanted or not? With the current size of the project I wasn't very sure if it wanted to add.
    • Currently everything is in one PR. Is it wanted to split it? (Like PRs for the changes on the checks, a PR for the structure changes and PRs for the new tests?) And if wanted I can create a new one with more clear commits because I understand some of them aren't very clear.

    Todo:

    • ~~Add a test for the PhpExtensionsAreInstalled check, this is the only check without tests so I should like to also add that one.~~

    I should really like to get some feedback on the work that is done. Is something missing? Something done that isn't wanted? Do you see something strange in the code?

    Reviewed by tvbeek at 2018-10-01 21:19
  • 2. [Laravel 7] fix dotenv 4 checks

    After using the new version on a Laravel 7 app, DotEnv related checks failed due to changes on the DotEnv constructor and static constructors (::create(...))

    Reference: https://github.com/vlucas/phpdotenv/blob/v4.0.1/UPGRADING.md#v3-to-v4

    This PR update these checks:

    • ExampleEnvironmentVariablesAreSet
    • ExampleEnvironmentVariablesAreUpToDate

    To comply with the new DotEnv's version.

    Note: I added a separated method for DotEnv 4 with a early return to avoid adding to many if branches in each class' check method.

    Reviewed by rodrigopedra at 2020-03-12 13:31
  • 3. Upgrade dotenv to v3

    There's an incompatibility with Laravel 5.8 and this because of vlucas/phpdotenv between each's composer.json.

    | Project | Dependency | Version | |-------------------------------------|--------------------|---------| | laravel/framework | vlucas/phpdotenv | ^3.3 | | beyondcode/laravel-self-diagnosis | vlucas/phpdotenv | ~2.5 |

    I know this PR's current state is not the best way to fix it (unless you want to release a new major version), as it will break backwards compatibility, but here's a first attempt to hopefully help at least get it started. This fixes it for 5.8.

    Reviewed by fitztrev at 2019-02-26 19:38
  • 4. Add check for log files in production

    This check adds the possibility to check if your production environment contains log files (for example from reported exceptions). Ignoring certain files is possible too. Currently some tests are needed 😄

    Reviewed by DevDavido at 2018-09-25 17:54
  • 5. Install fails in new 5.6 project

    $ composer require beyondcode/laravel-self-diagnosis
    Using version ^0.2.0 for beyondcode/laravel-self-diagnosis
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for beyondcode/laravel-self-diagnosis ^0.2.0 -> satisfiable by beyondcode/laravel-self-diagnosis[0.2.0].
        - Conclusion: remove vlucas/phpdotenv v2.4.0
        - Conclusion: don't install vlucas/phpdotenv v2.4.0
        - beyondcode/laravel-self-diagnosis 0.2.0 requires vlucas/phpdotenv ~2.5 -> satisfiable by vlucas/phpdotenv[2.5.x-dev, v2.5.0].
        - Can only install one of: vlucas/phpdotenv[2.5.x-dev, v2.4.0].
        - Can only install one of: vlucas/phpdotenv[v2.5.0, v2.4.0].
        - Installation request for vlucas/phpdotenv (locked at v2.4.0) -> satisfiable by vlucas/phpdotenv[v2.4.0].
    
    
    Installation failed, reverting ./composer.json to its original content.
    

    Can I give you any further info?

    Reviewed by sunscreem at 2018-07-06 12:39
  • 6. Not working in laravel 8.6

    I have try to install but it gives me this error

    Using version ^1.4 for beyondcode/laravel-self-diagnosis ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

    Problem 1 - Conclusion: don't install beyondcode/laravel-self-diagnosis 1.4.3 - Conclusion: don't install beyondcode/laravel-self-diagnosis 1.4.2 - Conclusion: don't install beyondcode/laravel-self-diagnosis 1.4.1 - Conclusion: remove laravel/framework v8.6.0 - Installation request for beyondcode/laravel-self-diagnosis ^1.4 -> satisfiable by beyondcode/laravel-self-diagnosis[1.4.0, 1.4.1, 1.4.2, 1.4.3]. - Conclusion: don't install laravel/framework v8.6.0 - beyondcode/laravel-self-diagnosis 1.4.0 requires illuminate/support 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0 -> satisfiable by illuminate/support[5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, 6.x-dev, 7.x-dev, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.10.0, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.18.0, v6.18.1, v6.18.10, v6.18.11, v6.18.12, v6.18.13, v6.18.14, v6.18.15, v6.18.16, v6.18.17, v6.18.18, v6.18.19, v6.18.2, v6.18.20, v6.18.21, v6.18.22, v6.18.23, v6.18.24, v6.18.25, v6.18.26, v6.18.27, v6.18.28, v6.18.29, v6.18.3, v6.18.30, v6.18.31, v6.18.32, v6.18.33, v6.18.34, v6.18.35, v6.18.36, v6.18.37, v6.18.38, v6.18.39, v6.18.4, v6.18.40, v6.18.5, v6.18.6, v6.18.7, v6.18.8, v6.18.9, v6.2.0, v6.3.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.10.0, v7.10.1, v7.10.2, v7.10.3, v7.11.0, v7.12.0, v7.13.0, v7.14.0, v7.14.1, v7.15.0, v7.16.0, v7.16.1, v7.17.0, v7.17.1, v7.17.2, v7.18.0, v7.19.0, v7.19.1, v7.2.0, v7.2.1, v7.2.2, v7.20.0, v7.21.0, v7.22.0, v7.22.1, v7.22.2, v7.22.3, v7.22.4, v7.23.0, v7.23.1, v7.23.2, v7.24.0, v7.25.0, v7.26.0, v7.26.1, v7.27.0, v7.28.0, v7.28.1, v7.28.2, v7.28.3, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2, v7.6.0, v7.6.1, v7.6.2, v7.7.0, v7.7.1, v7.8.0, v7.8.1, v7.9.0, v7.9.1, v7.9.2]. - don't install illuminate/support 6.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support 7.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.0.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.0.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.0.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.0.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.0.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.1.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.10.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.11.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.12.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.13.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.13.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.14.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.15.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.15.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.16.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.17.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.17.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.10|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.11|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.12|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.13|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.14|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.15|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.16|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.17|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.18|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.19|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.20|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.21|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.22|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.23|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.24|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.25|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.26|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.27|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.28|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.29|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.30|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.31|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.32|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.33|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.34|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.35|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.36|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.37|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.38|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.39|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.40|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.5|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.6|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.7|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.8|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.18.9|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.2.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.3.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.4.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.5.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.5.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.5.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.6.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.6.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.6.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.7.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v6.8.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.5|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.6|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.7|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.0.8|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.1.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.1.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.1.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.1.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.10.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.10.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.10.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.10.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.11.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.12.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.13.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.14.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.14.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.15.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.16.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.16.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.17.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.17.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.17.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.18.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.19.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.19.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.2.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.2.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.2.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.20.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.21.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.22.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.22.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.22.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.22.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.22.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.23.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.23.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.23.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.24.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.25.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.26.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.26.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.27.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.28.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.28.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.28.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.28.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.3.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.4.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.5.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.5.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.5.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.6.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.6.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.6.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.7.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.7.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.8.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.8.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.9.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.9.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v7.9.2|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.5.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.16|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.17|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.28|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.33|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.34|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.35|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.36|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.37|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.39|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.40|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.41|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.43|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.5.44|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.6.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.10|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.11|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.12|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.13|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.14|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.15|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.16|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.17|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.19|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.20|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.21|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.22|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.23|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.24|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.25|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.26|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.27|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.28|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.29|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.30|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.31|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.32|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.33|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.34|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.35|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.36|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.37|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.38|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.39|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.5|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.6|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.7|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.8|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.6.9|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.7.17|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.7.18|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.7.19|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.7.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.1|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.10|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.11|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.15|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.20|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.21|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.22|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.23|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.26|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.27|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.28|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.5|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.6|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.7|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.8|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.7.9|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.8.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.11|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.12|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.14|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.15|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.17|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.18|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.19|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.2|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.20|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.22|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.24|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.27|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.28|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.29|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.3|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.30|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.31|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.32|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.33|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.34|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.35|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.36|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.8|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.8.9|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.2.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.3.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support 5.4.x-dev|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.19|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.21|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.24|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.25|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.26|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.27|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.28|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.31|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.32|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.37|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.43|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.45|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.6|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.2.7|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.3.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.3.16|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.3.23|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.3.4|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.0|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.13|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.17|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.19|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.27|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.36|don't install laravel/framework v8.6.0 - don't install illuminate/support v5.4.9|don't install laravel/framework v8.6.0 - Installation request for laravel/framework (locked at v8.6.0, required as ^8.0) -> satisfiable by laravel/framework[v8.6.0].

    Installation failed, reverting ./composer.json to its original content.

    Reviewed by Nikunj1696 at 2020-09-25 10:07
  • 7. Fix composer and command exit code

    1.5.0 - 2018-XX-XX

    Changed

    • DocBlocks updated
    • If self-diagnosis command fails - exit code is greater than 0 #33
    • Minimal php version up to v7.1.3
    • Required package illuminate/support changed to laravel/framework (this package uses ServiceProvider, ConsoleCommand classes from him)
    Reviewed by tarampampam at 2018-07-10 18:51
  • 8. "Your requirements could not be resolved to an installable set of packages."

    I'm trying to require this for dev, but it's unable to install due to some issue with constraints:

    Using version ^0.3.0 for beyondcode/laravel-self-diagnosis
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for beyondcode/laravel-self-diagnosis ^0.3.0 -> satisfiable by beyondcode/laravel-self-diagnosis[0.3.0].
        - Conclusion: remove vlucas/phpdotenv v2.4.0
        - Conclusion: don't install vlucas/phpdotenv v2.4.0
        - beyondcode/laravel-self-diagnosis 0.3.0 requires vlucas/phpdotenv ~2.5 -> satisfiable by vlucas/phpdotenv[2.5.x-dev, v2.5.0].
        - Can only install one of: vlucas/phpdotenv[2.5.x-dev, v2.4.0].
        - Can only install one of: vlucas/phpdotenv[v2.5.0, v2.4.0].
        - Installation request for vlucas/phpdotenv (locked at v2.4.0) -> satisfiable by vlucas/phpdotenv[v2.4.0].
    
    
    Installation failed, reverting ./composer.json to its original content.
    

    My dependencies:

    "require": {                                  
        "php": "^7.1.3",                          
        "cakephp/chronos": "^1.1",                
        "fideloper/proxy": "^4.0",                
        "guzzlehttp/guzzle": "^6.3",              
        "laravel/framework": "5.6.*",             
        "laravel/tinker": "^1.0",                 
        "ramsey/uuid": "^3.7",                    
        "stephenhill/base58": "^1.1",             
        "symfony/psr-http-message-bridge": "^1.0",
        "tymon/jwt-auth": "^0.5.12",              
        "zendframework/zend-diactoros": "^1.8"    
    },                                            
    "require-dev": {                              
        "barryvdh/laravel-ide-helper": "^2.4",    
        "darkaonline/l5-swagger": "^5.6",         
        "filp/whoops": "^2.0",                    
        "fzaninotto/faker": "^1.4",               
        "mockery/mockery": "^1.0",                
        "nunomaduro/collision": "^2.0",           
        "phpunit/phpunit": "^7.0"                 
    },                                            
    
    Reviewed by amcsi at 2018-07-06 18:19
  • 9. Fix dotv5 - Laravel 8 and config cache

    fix #103

    This PR fix ExampleEnvironmentVariablesAreSet for Laravel 8 (dotenv 5) when config is cache.

    Before fix

    ➜ php artisan self-diagnosis
    |-------------------------------------
    | Common Checks
    |-------------------------------------
    Running check 1/12: App key is set...  ✔
    Running check 2/12: The correct PHP version is installed...  ✔
    Running check 3/12: The database can be accessed...  ✔
    Running check 4/12: All directories have the correct permissions...  ✔
    Running check 5/12: The environment file exists...  ✔
    Running check 6/12: The example environment variables are set...  ✘
    Running check 7/12: Required locales are installed...  ✔
    Running check 8/12: Maintenance mode is not enabled...  ✔
    Running check 9/12: The migrations are up to date...  ✔
    Running check 10/12: The required PHP extensions are installed...  ✔
    Running check 11/12: The storage directory is linked...  ✔
    Running check 12/12: Meta robot - Noindex Nofollow check...  ✔
    
    |-------------------------------------
    | Environment Specific Checks (production)
    |-------------------------------------
    Running check 1/5: Composer dependencies (without dev) are up to date...  ✔
    Running check 2/5: Configuration is cached...  ✔
    Running check 3/5: Debug mode is not enabled...  ✔
    Running check 4/5: Unwanted PHP extensions are disabled...  ✘
    Running check 5/5: Routes are cached...  ✔
    
    The following checks failed:
    These environment variables are missing in your .env file, but are defined in your .env.example:
    APP_NAME
    APP_ENV
    APP_KEY
    APP_DEBUG
    APP_URL
    LOG_CHANNEL
    LOG_LEVEL
    DB_CONNECTION
    DB_HOST
    DB_PORT
    DB_DATABASE
    DB_USERNAME
    DB_PASSWORD
    BROADCAST_DRIVER
    CACHE_DRIVER
    QUEUE_CONNECTION
    SESSION_DRIVER
    SESSION_LIFETIME
    MEMCACHED_HOST
    REDIS_HOST
    REDIS_PASSWORD
    REDIS_PORT
    MAIL_MAILER
    MAIL_HOST
    MAIL_PORT
    MAIL_USERNAME
    MAIL_PASSWORD
    MAIL_ENCRYPTION
    MAIL_FROM_ADDRESS
    MAIL_FROM_NAME
    AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY
    AWS_DEFAULT_REGION
    AWS_BUCKET
    PUSHER_APP_ID
    PUSHER_APP_KEY
    PUSHER_APP_SECRET
    PUSHER_APP_CLUSTER
    MIX_PUSHER_APP_KEY
    MIX_PUSHER_APP_CLUSTER
    
    The following extensions are still enabled:
    xdebug
    

    After fix

    ➜ php artisan self-diagnosis
    |-------------------------------------
    | Common Checks
    |-------------------------------------
    Running check 1/12: App key is set...  ✔
    Running check 2/12: The correct PHP version is installed...  ✔
    Running check 3/12: The database can be accessed...  ✔
    Running check 4/12: All directories have the correct permissions...  ✔
    Running check 5/12: The environment file exists...  ✔
    Running check 6/12: The example environment variables are set...  ✔
    Running check 7/12: Required locales are installed...  ✔
    Running check 8/12: Maintenance mode is not enabled...  ✔
    Running check 9/12: The migrations are up to date...  ✔
    Running check 10/12: The required PHP extensions are installed...  ✔
    Running check 11/12: The storage directory is linked...  ✔
    Running check 12/12: Meta robot - Noindex Nofollow check...  ✔
    
    |-------------------------------------
    | Environment Specific Checks (production)
    |-------------------------------------
    Running check 1/5: Composer dependencies (without dev) are up to date...  ✔
    Running check 2/5: Configuration is cached...  ✔
    Running check 3/5: Debug mode is not enabled...  ✔
    Running check 4/5: Unwanted PHP extensions are disabled...  ✘
    Running check 5/5: Routes are cached...  ✔
    
    The following checks failed:
    The following extensions are still enabled:
    xdebug
    
    Reviewed by thomascombe at 2021-06-11 20:22
  • 10. Composer::installDryRun() calling getProcess without argument

    Too few arguments to function Illuminate\Support\Composer::getProcess(), 0 passed in /vendor/beyondcode/laravel-self-diagnosis/src/Composer.php on line 9 and exactly 1 expected
    

    Looks like Laravel 5.8 changed Illuminate\Support\Composer::getProcess() to have a required array $command argument.

    Reviewed by kbond at 2019-02-27 12:09
  • 11. Fix the PHP version check with the use of Semver

    The current check only takes the PHP version from the composer.json file and checks if the current version is the same or higher. But composer has more options, that if used can be conflicted or incorrect tested. See: https://getcomposer.org/doc/articles/versions.md#summary

    I have changed the behaviour by using the Semver package from composer to check it.

    The only question I have is the change on the getRequiredPhpVersion function. Because it is a public function I didn't want to change it and added a new function getRequiredPhpConstraint. That means that there is now a function that isn't used by the check. If wanted I can mark it as deprecated

    Reviewed by tvbeek at 2018-07-25 21:19
  • 12. Incorrect php extension parsing in Laravel Sail

    Running this package in Laravel sail returns an incorrect error message:

    The following extensions are missing:
    imagick
    

    Running the following command shows that imagick is actually installed:

    sail php -r 'echo "imagick is ".(extension_loaded("imagick")?"":"not ")."installed\n";'
    

    Also, sail php -m has the following output, which includes imagick:

    [PHP Modules]
    bcmath
    calendar
    Core
    ctype
    curl
    date
    dom
    exif
    FFI
    fileinfo
    filter
    ftp
    gd
    gettext
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    ldap
    libxml
    mbstring
    memcached
    msgpack
    mysqli
    mysqlnd
    openssl
    pcntl
    pcov
    pcre
    PDO
    pdo_mysql
    pdo_pgsql
    pdo_sqlite
    pgsql
    Phar
    posix
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    sodium
    SPL
    sqlite3
    standard
    swoole
    sysvmsg
    sysvsem
    sysvshm
    tokenizer
    xdebug
    xml
    xmlreader
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Xdebug
    Zend OPcache
    

    I am running:

    • Laravel 8.65+
    • Laravel Sail 1.5+

    Here is the self-diagnosis.php config file:

    <?php
    
    declare(strict_types=1);
    
    use BeyondCode\SelfDiagnosis\Checks\AppKeyIsSet;
    use BeyondCode\SelfDiagnosis\Checks\ComposerWithDevDependenciesIsUpToDate;
    use BeyondCode\SelfDiagnosis\Checks\ComposerWithoutDevDependenciesIsUpToDate;
    use BeyondCode\SelfDiagnosis\Checks\ConfigurationIsCached;
    use BeyondCode\SelfDiagnosis\Checks\ConfigurationIsNotCached;
    use BeyondCode\SelfDiagnosis\Checks\CorrectPhpVersionIsInstalled;
    use BeyondCode\SelfDiagnosis\Checks\DatabaseCanBeAccessed;
    use BeyondCode\SelfDiagnosis\Checks\DebugModeIsNotEnabled;
    use BeyondCode\SelfDiagnosis\Checks\DirectoriesHaveCorrectPermissions;
    use BeyondCode\SelfDiagnosis\Checks\EnvFileExists;
    use BeyondCode\SelfDiagnosis\Checks\ExampleEnvironmentVariablesAreSet;
    use BeyondCode\SelfDiagnosis\Checks\ExampleEnvironmentVariablesAreUpToDate;
    use BeyondCode\SelfDiagnosis\Checks\HorizonIsRunning;
    use BeyondCode\SelfDiagnosis\Checks\LocalesAreInstalled;
    use BeyondCode\SelfDiagnosis\Checks\MaintenanceModeNotEnabled;
    use BeyondCode\SelfDiagnosis\Checks\MigrationsAreUpToDate;
    use BeyondCode\SelfDiagnosis\Checks\PhpExtensionsAreDisabled;
    use BeyondCode\SelfDiagnosis\Checks\PhpExtensionsAreInstalled;
    use BeyondCode\SelfDiagnosis\Checks\RedisCanBeAccessed;
    use BeyondCode\SelfDiagnosis\Checks\RoutesAreCached;
    use BeyondCode\SelfDiagnosis\Checks\RoutesAreNotCached;
    use BeyondCode\SelfDiagnosis\Checks\ServersArePingable;
    use BeyondCode\SelfDiagnosis\Checks\StorageDirectoryIsLinked;
    use BeyondCode\SelfDiagnosis\Checks\SupervisorProgramsAreRunning;
    
    return [
    
        /*
         * A list of environment aliases mapped to the actual environment configuration.
         */
        'environment_aliases' => [
            'prod' => 'production',
            'live' => 'production',
            'local' => 'development',
        ],
    
        /*
         * Common checks that will be performed on all environments.
         */
        'checks' => [
            AppKeyIsSet::class,
            CorrectPhpVersionIsInstalled::class,
            DatabaseCanBeAccessed::class => [
                'default_connection' => true,
                'connections' => [],
            ],
            DirectoriesHaveCorrectPermissions::class => [
                'directories' => [
                    storage_path(),
                    base_path('bootstrap/cache'),
                ],
            ],
            EnvFileExists::class,
            ExampleEnvironmentVariablesAreSet::class,
            // LocalesAreInstalled::class => [
            //     'required_locales' => [
            //         'en_US',
            //         PHP_OS === 'Darwin' ? 'en_US.UTF-8' : 'en_US.utf8',
            //     ],
            // ],
            MaintenanceModeNotEnabled::class,
            MigrationsAreUpToDate::class,
            PhpExtensionsAreInstalled::class => [
                'extensions' => [
                    "bcmath",
                    "calendar",
                    "ctype",
                    "curl",
                    "dom",
                    "exif",
                    "gd",
                    "iconv",
                    "imagick",
                    "intl",
                    "json",
                    "libxml",
                    "mbstring",
                    "mbstring",
                    "openssl",
                    "pcntl",
                    "pcov",
                    "pdo_pgsql",
                    "pdo_sqlite",
                    "pdo",
                    "soap",
                    "tokenizer",
                    "xml",
                    "zip",
                ],
                'include_composer_extensions' => true,
            ],
            // RedisCanBeAccessed::class => [
            //     'default_connection' => true,
            //     'connections' => ["default"],
            // ],
            StorageDirectoryIsLinked::class,
        ],
    
        /*
         * Environment specific checks that will only be performed for the corresponding environment.
         */
        'environment_checks' => [
            'development' => [
                ComposerWithDevDependenciesIsUpToDate::class,
                ConfigurationIsNotCached::class,
                RoutesAreNotCached::class,
                ExampleEnvironmentVariablesAreUpToDate::class,
            ],
            'production' => [
                ComposerWithoutDevDependenciesIsUpToDate::class,
                ConfigurationIsCached::class,
                DebugModeIsNotEnabled::class,
                PhpExtensionsAreDisabled::class => [
                    'extensions' => [
                        'xdebug',
                    ],
                ],
                RoutesAreCached::class,
                // ServersArePingable::class => [
                //    'servers' => [
                //        'www.google.com',
                //        ['host' => 'www.google.com', 'port' => 8080],
                //        '8.8.8.8',
                //        ['host' => '8.8.8.8', 'port' => 8080, 'timeout' => 5],
                //    ],
                //],
                SupervisorProgramsAreRunning::class => [
                    'programs' => [
                        'horizon',
                    ],
                    'restarted_within' => 300,
                ],
                HorizonIsRunning::class,
            ],
        ],
    
    ];
    
    Reviewed by mikebronner at 2022-02-15 23:46
  • 13. Laravel 9.x Compatibility

    This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 9.x.

    Before merging, you need to:

    • Checkout the l9-compatibility branch
    • Review all comments for additional changes
    • Thoroughly test your package

    If you do find an issue, please report it by commenting on this PR to help improve future automation.

    Reviewed by laravel-shift at 2022-02-05 15:32
  • 14. New Release for PHP8 Support

    While there was a PR that was accepted to add PHP 8 support there has been no release since then and 1.5.0 does not have the php8 pr in it.

    Please submit a new release.

    Reviewed by HDVinnie at 2021-10-20 03:31
  • 15. Doesn't work with latest laravel version

    Using:

    • Laravel 7.2.5
    • PHP 7.3.19
    • composer 1.10.8
    > php artisan self-diagnosis
    |-------------------------------------
    | Common Checks
    |-------------------------------------
    
    
       ErrorException 
    
      array_key_exists() expects parameter 2 to be array, null given
    
      at vendor/beyondcode/laravel-self-diagnosis/src/SelfDiagnosisCommand.php:33
        29| 
        30|         $environment = $this->argument('environment') ?: app()->environment();
        31|         $environmentChecks = config('self-diagnosis.environment_checks.' . $environment, []);
        32| 
      > 33|         if (empty($environmentChecks) && array_key_exists($environment, config('self-diagnosis.environment_aliases'))) {
        34|             $environment = config('self-diagnosis.environment_aliases.' . $environment);
        35|             $environmentChecks = config('self-diagnosis.environment_checks.' . $environment, []);
        36|         }
        37| 
    
          +15 vendor frames 
      16  artisan:37
          Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    
    
    Reviewed by EM-LilianaIturribarria at 2020-07-07 00:51
  • 16. Add check for empty environmental variables

    I've added a slimmed down implementation of laravel-env-scanner to count undefined environmental variables used in config/ and app/ directories by env() & getenv() helpers.

    Reviewed by mtolhuys at 2019-07-20 21:22
A package for Laravel to perform basic git commands on locally integrated packages.

A package for Laravel to perform basic git commands on locally integrated development packages. If working within multiple local development packages or repositories at once this package is meant to ease the burden of navigating to each individual repository to perform basic git commands.

Sep 30, 2021
Perform Bulk/Batch Update/Insert/Delete with laravel.

Bulk Query Perform Bulk/Batch Update/Insert/Delete with laravel. Problem I tried to make bulk update with laravel but i found that Laravel doesn't sup

Dec 14, 2021
Laravel-veneer - A suite of mocked services to use in your Laravel tests.

Laravel Veneer A suite of fixture data and methods to help make mocking 3rd party services easier. Overview Laravel Veneer aims to solve two problems

Mar 15, 2022
Chrome extension to generate Laravel integration tests while using your app.

Laravel TestTools Check out the introduction post about the chrome extension. Installation git clone [email protected]:mpociot/laravel-testtools.git # i

May 12, 2022
Testbench Component is the de-facto package that has been designed to help you write tests for your Laravel package

Laravel Testing Helper for Packages Development Testbench Component is the de-facto package that has been designed to help you write tests for your La

May 20, 2022
This package provides a trait to run your tests against a MinIO S3 server.

Laravel MinIO Testing Tools This package provides a trait to run your tests against a MinIO S3 server. ?? Blog post: https://protone.media/en/blog/how

May 20, 2022
Fully customizable and tests supported Laravel admin dashboard for developers.

Laravel Admin dashboard Like Laravel Jetstream but built with Hotwire Turbo + additional perks. Tools used: tailwindcomponents/dashboard Hotwire Turbo

Apr 25, 2022
Removes whitelisted unnecessary files (like tests/docs etc.) from vendor directory

Composer vendor cleanup This is a simple script for the Composer to remove unnecessary files (documentation/examples/tests etc.) from included vendor

May 23, 2021
Generator-hedley - Scaffold a headless Drupal backend, Angular app client, and Behat tests

generator-hedley Scaffold a headless Drupal backend, Angular app client, and Behat tests Hedley is a yeoman generator that scaffolds a headless Drupal

Dec 3, 2021
Manage self-hosted Google Fonts in Laravel apps
 Manage self-hosted Google Fonts in Laravel apps

This package makes self-hosting Google Fonts as frictionless as possible for Laravel users. To load fonts in your application, register a Google Fonts embed URL and load it with the @googlefonts Blade directive.

May 18, 2022
Self-hosted CMS platform based on the Laravel PHP Framework.
Self-hosted CMS platform based on the Laravel PHP Framework.

October is a Content Management System (CMS) and web platform whose sole purpose is to make your development workflow simple again. It was born out of

May 17, 2022
Intranet Home Page is a highly-configurable self-hosted browser homepage with integrations for public and local data feeds.
Intranet Home Page is a highly-configurable self-hosted browser homepage with integrations for public and local data feeds.

Intranet-Home-Page Created in response to personal "dashboards" that are little more than pages with a list of frequently accessed links, Intranet Hom

May 18, 2022
Automatically load your helpers in your laravel application.

Laravel AutoHelpers Automatically load your helpers in your laravel application. Installation You can install the package via composer: composer requi

Jul 26, 2021
Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application.

Laravel Segment Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application. Installation You can install the pac

Apr 1, 2022
Jetstrap is a lightweight laravel 8 package that focuses on the VIEW side of Jetstream / Breeze package installed in your Laravel application

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.

May 13, 2022
Laravel Larex lets you translate your whole Laravel application from a single CSV file.
Laravel Larex lets you translate your whole Laravel application from a single CSV file.

Laravel Larex Translate Laravel Apps from a CSV File Laravel Larex lets you translate your whole Laravel application from a single CSV file. You can i

Apr 2, 2022
Laravel package to find performance bottlenecks in your laravel application.
Laravel package to find performance bottlenecks in your laravel application.

Laravel Meter Laravel Meter monitors application performance for different things such as requests, commands, queries, events, etc and presents result

May 13, 2022
Laravel-tagmanager - An easier way to add Google Tag Manager to your Laravel application.

Laravel TagManager An easier way to add Google Tag Manager to your Laravel application. Including recommended GTM events support. Requirements Laravel

Apr 19, 2022
Laravel Logable is a simple way to log http request in your Laravel application.
 Laravel Logable is a simple way to log http request in your Laravel application.

Laravel Logable is a simple way to log http request in your Laravel application. Requirements php >= 7.4 Laravel version >= 6.0 Installation composer

Feb 5, 2022