You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
572 B
PHP
28 lines
572 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Contract\ServiceContract;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
use Hyperf\Validation\Contract\ValidatorFactoryInterface;
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
/**
|
|
* @property ServiceContract $service
|
|
* @property FormRequest $request
|
|
*/
|
|
abstract class BaseController
|
|
{
|
|
#[Inject]
|
|
protected ValidatorFactoryInterface $validator;
|
|
|
|
protected function getService(): ServiceContract
|
|
{
|
|
return $this->service;
|
|
}
|
|
|
|
protected function getRequest(): FormRequest
|
|
{
|
|
return $this->request;
|
|
}
|
|
} |