36 lines
994 B
PHP
36 lines
994 B
PHP
<?php
|
|
/**
|
|
* This file is part of webman.
|
|
*
|
|
* Licensed under The MIT License
|
|
* For full copyright and license information, please see the MIT-LICENSE.txt
|
|
* Redistributions of files must retain the above copyright notice.
|
|
*
|
|
* @author walkor<walkor@workerman.net>
|
|
* @copyright walkor<walkor@workerman.net>
|
|
* @link http://www.workerman.net/
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
|
*/
|
|
|
|
// 初始化 Laravel 容器
|
|
use Illuminate\Container\Container;
|
|
use Illuminate\Support\Facades\Facade;
|
|
|
|
$container = Container::getInstance();
|
|
|
|
// 将容器设置为 Facade 的根
|
|
Facade::setFacadeApplication($container);
|
|
|
|
// 注册验证器服务(关键步骤)
|
|
$container->singleton('validator', function () {
|
|
return new \Illuminate\Validation\Factory(
|
|
new \Illuminate\Translation\Translator(
|
|
new \Illuminate\Translation\ArrayLoader(), 'en' // 默认语言
|
|
)
|
|
);
|
|
});
|
|
|
|
return [
|
|
support\bootstrap\Session::class,
|
|
];
|