承接 johntout/laravel-forge-panel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

johntout/laravel-forge-panel

最新稳定版本:v0.3.0

Composer 安装命令:

composer require johntout/laravel-forge-panel

包简介

Add a panel to your app to manage various actions on Laravel Forge

README 文档

README

Add a panel to your app in order to manage various actions on Laravel Forge.

Currently supported actions are:

  • Get server information
  • Get site information
  • Get and update .env file
  • Execute commands

Laravel Forge Panel

Installation

You can install the package via composer:

composer require johntout/laravel-forge-panel

Then run the install command to publish the assets.

php artisan laravel-forge-panel:install

In your .env file you must save the following env variables in order to connect to your Laravel Forge account:

LARAVEL_FORGE_TOKEN=
LARAVEL_FORGE_SERVER_ID=
LARAVEL_FORGE_SITE_ID=

You can obtain your token through your Laravel Forge profile. The server id and the site id can be found on the top of your Laravel Forge site page.

You can access the Laravel Forge panel by visiting the page /forge-panel. By default the panel is accessible in local environment. On production environment you must define the Gate below in the boot method of your AppServiceProvider, with your criteria, in order to access the panel.

use App\Models\User;
use Illuminate\Support\Facades\Gate;

Gate::define('viewLaravelForgePanel', function (User $user) {
    return $user->is_developer;
});

Config file:

return [
    'middleware' => [
        'web',
    ],
    'route' => 'forge-panel',
    'token' => env('LARAVEL_FORGE_TOKEN'),
    'server_id' => env('LARAVEL_FORGE_SERVER_ID'),
    'site_id' => env('LARAVEL_FORGE_SITE_ID'),
];

All config options can be overwritten by publishing the configuration file using php artisan vendor:publish --tag=laravel-forge-panel-config. If you add new configuration options they will be merged with the default ones from the package.

License

The package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-27