hollisho / lumen-request by hollisho

http Request For Lumen
6
0
1
Package Data
Maintainer Username: hollisho
Maintainer Contact: he_wenzhi@126.com (Hollis Ho)
Package Create Date: 2024-09-16
Package Last Update: 2024-10-15
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2025-01-01 15:00:05
Package Statistics
Total Downloads: 6
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

install

composer require hollisho/lumen-request

basic use


//定义Request对象
class RequestBo extend BaseRequest
{
    public $html_content;

    public $language_edit = 0;

    public function rules()
    {
        return [
            'html_content' => ['required'],
        ];
    }

    protected function messages()
    {
        return [
            'html_content.required' => 'html_content is required',
        ];
    }
}

//在控制器中注入Reqeust
class IndexController extends Controller
{

    /**
     * @param FetchHtmlRequest $request
     * @param DomRenderService $renderService
     * @return \Illuminate\Http\JsonResponse
     */
    public function parserHtml(RequestBo $request)
    {
        ......
    }
}