123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace App\Repositories;
- use App\Models\Bike;
- class BaseRepository
- {
- protected $model;
-
- public function byIdGetModel($id)
- {
- return $this->model->where('id', $id)->first();
- }
-
- public function all()
- {
- return $this->model->get();
- }
- public function byIdGetBoxNo($id)
- {
- return $this->model->where('id', $id)->value('box_no');
- }
- public function byIdGetNoRidingBoxNo($id)
- {
- return $this->model->where('id', $id)->where('is_riding', Bike::RIDING_NO)->value('box_no');
- }
- }
|