123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Repositories\Eloquent\Base;
- use App\Contracts\Repositories\Base\AuthRepository;
- use App\Repositories\Models\Base\Auth;
- use App\Repositories\Validators\Base\AuthValidator;
- use Prettus\Repository\Criteria\RequestCriteria;
- use Prettus\Repository\Eloquent\BaseRepository;
- class AuthRepositoryEloquent extends BaseRepository implements AuthRepository
- {
- protected $fieldSearchable = [
- // 'name' => 'like', Default Condition "="
- ];
- /**
- * Specify Model class name.
- *
- * @return string
- */
- public function model()
- {
- return Auth::class;
- }
- /**
- * Boot up the repository, pushing criteria.
- *
- * @throws \Prettus\Repository\Exceptions\RepositoryException
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- /**
- * @return mixed
- */
- public function searchAuthsByPage()
- {
- return $this->paginate(request('per_page', 15));
- }
- /**
- * @param $id
- *
- * @return mixed
- */
- public function searchAuthBy($id)
- {
- return $this->find($id);
- }
- }
|