devzkhalil/installer

该软件包最新版本(v2.0.0)没有提供许可证信息。

v2.0.0 2024-08-02 06:21 UTC

This package is not auto-updated.

Last update: 2024-09-20 04:10:56 UTC


README

在发布字段中,您需要的laravel应用安装包。为您的应用程序提供的最简单、最简约的安装程序。适用于任何laravel版本!

安装

您可以通过composer安装此包

composer require devzkhalil/laravel-one-click-installer

发布配置

发布配置文件

php artisan vendor:publish --tag=installer-config

发布资源

发布资源文件

php artisan vendor:publish --tag=installer-assets

设置和配置

此包的主要工作仅为安装程序配置。因此,请仔细遵循此步骤。
配置文件 config/installer.php 包含一些安装属性。这些属性在文件的注释中也有很好的文档说明。这里也给出了简要描述。

    /**
     * INSTALLER CONFIGURATION
     * --------------------------------------
     * Configure your application installer
     * before deploying the installer.
     */
    
    'php' => [
        /**
         * MINIMUM PHP VERSION
         * --------------------------------------
         * Define the minimum PHP version required
         * for your application.
         */
        'min' => '8.3.0',

        /**
         * REQUIRED PHP EXTENSIONS
         * --------------------------------------
         * Define the PHP extensions required
         * for your application.
         */
        'extensions' => [
            'tokenizer',
            'json',
            'mbstring',
            'openssl',
            'dom',
            'libxml',
            'pdo',
            'phar',
            'xml',
            'xmlwriter',
            'curl',
            'gd',
            'pcntl',
            'posix',
            'fileinfo',
            'ftp',
        ],
    ],

    /**
     * INSTALLATION STEPS
     * --------------------------------------
     * Define all steps for the installer.
     * Comment out any step you don't need.
     * Do not change any word; altering the
     * steps can break the system.
     */
    'steps' => [
        // 'license_validation',
        'check_required_extensions',
        'basic_information_setup',
        'database_setup',
        'smtp_setup',
    ],

    /**
     * LICENSE INFORMATION
     * --------------------------------------
     * Provide your license validation API.
     */
    'license' => [
        'license_input_name' => 'license',
        'api' => null,
    ],

    /**
     * SYMLINK SUPPORT
     * --------------------------------------
     * If your migrations include the artisan
     * command `storage:link` or any symbolic
     * link operations, check if your hosting/system
     * supports creating symlinks.
     */
    'symlink' => true,

    /**
     * PERFORM MIGRATION?
     * --------------------------------------
     * Does your application run migrations
     * to set up your database?
     */
    'migration' => false,

    /**
     * SQL FILE NAME
     * --------------------------------------
     * If your application does not use
     * migrations to set up the database,
     * and you prefer using an SQL file,
     * define its name here.
     * 
     * Place the SQL file inside "database/sql/app.sql".
     * 
     * example: 'sql' => 'app.sql'
     */
    'sql' => null,

    /**
     * SMTP ENVIRONMENT VARIABLES
     * --------------------------------------
     * If you need to set up additional
     * environment variables during setup,
     * define them here.
     */
    'smtp' => [
        [
            'key' => 'MAIL_MAILER',
            'title' => 'SMTP Route'
        ],
        [
            'key' => 'MAIL_HOST',
            'title' => 'SMTP Mail Host'
        ],
        [
            'key' => 'MAIL_PORT',
            'title' => 'SMTP Mail Port'
        ],
        [
            'key' => 'MAIL_USERNAME',
            'title' => 'SMTP Mail Username'
        ],
        [
            'key' => 'MAIL_PASSWORD',
            'title' => 'SMTP Mail Password'
        ],
        [
            'key' => 'MAIL_ENCRYPTION',
            'title' => 'SMTP Encryption'
        ],
        [
            'key' => 'MAIL_FROM_ADDRESS',
            'title' => 'SMTP From Address'
        ],
        [
            'key' => 'MAIL_FROM_NAME',
            'title' => 'SMTP From Name'
        ],
    ],

    /**
     * COMPLETION REDIRECT
     * --------------------------------------
     * Define the URL to redirect to after
     * completing the installation.
     * 
     * example: '/home'
     */
    'redirect' => '/',

配置完成后

php artisan config:cache

用法

  • 安装此包
  • 保留一个骨架 .env 文件,其中包含初始 APP_KEY 生成
  • 浏览 your-site.com/install 以开始。

附加说明

  • 安装后,您无需删除任何文件或卸载包,它受中间件保护
  • 如果您想在安装后更改APP_KEY,请保留包含 Artisan::call('key:generate') 的迁移
  • 安装程序设置始终是开发者端的工作,因此请确保您的迁移正常运行无错误。开发者可以手动从全新终端安装检查迁移,即使安装程序给出了迁移输出,用户也无法调试您的迁移错误。因此,在应用安装程序之前,请确保您的迁移正确无误。

示例

LaravelOneClickInstaller | Step 1 LaravelOneClickInstaller | Step 2 LaravelOneClickInstaller | Step 3 LaravelOneClickInstaller | Step 4 LaravelOneClickInstaller | Step 5

高级用法

导出视图以自定义安装程序的设计!(如果您想自定义)

php artisan vendor:publish --tag=installer-views

变更日志

有关最近更改的更多信息,请参阅变更日志