devzkhalil/laravel-one-click-installer

此软件包最新版本(v2.0.0)没有可用的许可信息。

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

This package is not auto-updated.

Last update: 2024-09-28 05:12:54 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

更新日志

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