prototypehubs/artisan-gui

此包已被放弃,不再维护。作者建议使用tachii/artisan-gui包。

专为[laravel:artisan] gui设计的精美包,适合酷孩子们。


README

更新PHP 8.x和Laravel 10.x

Artisan GUI

68747470733a2f2f6c61726176656c2e636f6d2f696d672f6c6f676f747970652e6d696e2e737667:artisan gui

Packagist License Packagist Version Packagist Downloads Packagist PHP Version Support GitHub code size in bytes

一个简单但功能强大的库,用于运行一些artisan命令。

要求

  • Laravel 10.*
  • php ^8.0

安装

只需安装包

composer require infureal/artisan-gui

安装2.0.0@beta

composer require infureal/artisan-gui:2.0.0@beta

供应商发布

默认情况下,包具有预定义的配置和内联样式和脚本。自版本1.4起,您可以将CSS和JS文件等供应商发布到vendor/artisan-gui

php artisan vendor:publish --provider="Infureal\Providers\GuiServiceProvider"

仅发布配置

php artisan vendor:publish --tag="artisan-gui-config"

仅发布样式和脚本

php artisan vendor:publish --tag="artisan-gui-css-js"

运行命令

默认情况下,您只能在本地环境中访问此页面。如果您愿意,可以更改配置中的local键。

只需访问http://you-domain.com/~artisan即可。选择列表中的所需命令,填写参数和选项/标志,然后点击运行按钮。

2.0版本中的新功能

  • 迁移到SPA/Vue
  • UI更易于阅读(个人看法)
    • artisan-gui-2.0.0.png
  • 实现搜索(有了新的设计,没有搜索很难找到一些命令)
  • 在配置中添加权限字段(以便更灵活的调整)
  • 添加数组选项字段

配置

默认配置是

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Middleware list for web routes
    |--------------------------------------------------------------------------
    |
    | You can pass any middleware for routes, by default it's just [web] group
    | of middleware.
    |
    */
    'middlewares' => [
        'web',
//        'auth'
    ],

    /*
    |--------------------------------------------------------------------------
    | Route prefix
    |--------------------------------------------------------------------------
    |
    | Prefix for gui routes. By default url is [/~artisan-gui].
    | For your wish you can set it for example 'my-'. So url will be [/my-artisan-gui].
    |
    | Why tilda? It's selected for prevent route names correlation.
    |
    */
    'prefix' => '~',

    /*
    |--------------------------------------------------------------------------
    | Home url
    |--------------------------------------------------------------------------
    |
    | Where to go when [home] button is pressed
    |
    */
    'home' => '/',

    /*
    |--------------------------------------------------------------------------
    | Only on local
    |--------------------------------------------------------------------------
    |
    | Flag that preventing showing commands if environment is on production
    |
    */
    'local' => true,
    
    /*
    |--------------------------------------------------------------------------
    | List of command permissions
    |--------------------------------------------------------------------------
    |
    | Specify permissions to every single command. Can be a string or array
    | of permissions
    |
    | Example:
    |   'make:controller' => 'create-controller',
    |   'make:event' => ['generate-files', 'create-event'],
    |
    */
    'permissions' => [
    ],
    
    /*
    |--------------------------------------------------------------------------
    | List of commands
    |--------------------------------------------------------------------------
    |
    | List of all default commands that has end of execution. Commands like
    | [serve] not supported in case of server side behavior of php.
    | Keys means group. You can shuffle commands as you wish and add your own.
    |
    */
    'commands' => [
        // ...
    ]

];

问题

如果有任何问题,请联系我