mouyong / webman-laravel
Webman plugin mouyong/webman-laravel
dev-master
2022-11-22 00:57 UTC
Requires
- illuminate/auth: ^9.0
- illuminate/cache: ^9.0
- illuminate/config: ^9.0
- illuminate/console: ^9.0
- illuminate/container: ^9.0
- illuminate/database: ^9.0
- illuminate/events: ^9.0
- illuminate/log: ^9.0
- illuminate/notifications: ^9.0
- illuminate/redis: ^9.0
- illuminate/routing: ^9.0
- illuminate/testing: ^9.0
- illuminate/validation: ^9.0
- league/flysystem: ^3.6
- phpoption/phpoption: ^1.9
- vlucas/phpdotenv: ^5.4
- webman/console: ^1.2
This package is auto-updated.
Last update: 2024-12-22 05:39:51 UTC
README
- 在
start.php
中强制优先加载本地的./support/helpers.php
。使用webman/console
时,需要对./webman
可执行文件同样做如下更改,优先加载./support/helpers.php
。
#!/usr/bin/env php <?php // 避免加载了 laravel/illuminate/foundation/helper.php 导致无法控制顺序的函数重定义报错 require_once __DIR__ . '/support/helpers.php'; // <- here. require_once __DIR__ . '/vendor/autoload.php'; support\App::run();
- 移除
composer.json
中autoload.files
的./support/helpers.php
文件加载
{ ... "autoload": { "psr-4": { ... "": "./", "App\\": "./app" }, "files": [] // <- here. }, ... }
- 安装插件
composer require mouyong/webman-laravel:dev-master
配置项目
在 config/app.php 中增加如下内容
return [ ... 'name' => 'webman', 'env' => 'development', 'providers' => array_filter(array_map(function ($item) { if (class_exists($item)) { return $item; } }, [ /* * Laravel Framework Service Providers... */ Illuminate\Auth\AuthServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Bus\BusServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class, Illuminate\Encryption\EncryptionServiceProvider::class, Illuminate\Filesystem\FilesystemServiceProvider::class, Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class, Illuminate\Mail\MailServiceProvider::class, Illuminate\Notifications\NotificationServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class, Illuminate\Queue\QueueServiceProvider::class, Illuminate\Redis\RedisServiceProvider::class, Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, Illuminate\Session\SessionServiceProvider::class, Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, /** * 你安装的 laravel 扩展包 */ // \Fresns\PluginManager\Providers\PluginServiceProvider::class, /** * 项目的扩展包 */ \App\Providers\AppServiceProvider::class, ])), 'aliases' => \Illuminate\Support\Facades\Facade::defaultAliases()->merge([ // 'ExampleClass' => App\Example\ExampleClass::class, ])->toArray(), ];
更新 composer.json
composer.json
"scripts": { // 初始化 laravel-zero/illuminate 与相关配置 "post-autoload-dump": [ "MouYong\\WebmanLaravel\\ComposerScripts::postAutoloadDump" ], ... }
增加 Http 启动引导
config/bootstrap.php
return [ \MouYong\WebmanLaravel\LaravelBootstrap::class, ... ];
使用
php artisan
composer require illuminate/auth # 参考 `laravel` 官方配置 `config` 目录,增加相关的配置项:https://github.com/laravel/laravel