mohkoma/laravel-env-editor

1.0.2 2022-11-11 06:23 UTC

This package is auto-updated.

Last update: 2024-09-11 10:44:49 UTC


README

此包允许您直接在项目中编辑您的 .env 文件。我们构建这个包的想法是在我们将项目从 Forge 移动到 AWS 之后,我们希望保持 Forge 在编辑环境文件时提供相同的使用体验。我还尝试保持相同的 Forge 样式和行为(因为 Forge 很强大)。

Env editor

如何安装?

composer require mohkoma/laravel-env-editor

然后您需要发布资产:php artisan vendor:publish --tag=env-editor-assets

需求

PHP >= 7.4 Laravel >= 7.0

使用方法

安装完包后,您应该可以开始使用,默认访问编辑器的路由是 /dev/environment,但您也可以从配置文件中进行更改。要发布配置文件,只需运行:php artisan vendor:publish --tag=env-editor-config

如果您想自定义视图,可以使用以下命令发布视图文件:php artisan vendor:publish --tag=env-editor-views

请确保使用中间件给予正确的权限。

<?php

return [

    /**
     *  The middlewares for the env's routes
     */
    'middlewares' => [
        //\Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class
    ],