12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Repositories\Eloquent;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- use App\Repositories\MenuRepository;
- use App\Models\Menu;
- use App\Validators\MenuValidator;
- /**
- * Class MenuRepositoryEloquent.
- *
- * @package namespace App\Repositories\Eloquent;
- */
- class MenuRepositoryEloquent extends BaseRepository implements MenuRepository
- {
- /**
- * 查询检索的字段
- *
- * @return string
- */
- protected $fieldSearchable = [
- 'id' => '=',
- 'menu_name' => 'like',
- ];
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Menu::class;
- }
- /**
- * Specify Validator class name
- *
- * @return mixed
- */
- public function validator()
- {
- return MenuValidator::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- // $this->pushCriteria(app(RequestCriteria::class));
- }
- }
|