2017-06-11 07:27:19 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
|
|
|
use App\Models\Fare;
|
2017-12-07 12:48:42 +08:00
|
|
|
use App\Repositories\Traits\CacheableRepository;
|
2017-12-02 00:53:33 +08:00
|
|
|
use Prettus\Repository\Contracts\CacheableInterface;
|
2017-06-11 07:27:19 +08:00
|
|
|
|
2017-12-02 00:53:33 +08:00
|
|
|
class FareRepository extends BaseRepository implements CacheableInterface
|
2017-06-11 07:27:19 +08:00
|
|
|
{
|
2017-12-02 00:53:33 +08:00
|
|
|
use CacheableRepository;
|
|
|
|
|
2017-06-11 07:27:19 +08:00
|
|
|
protected $fieldSearchable = [
|
2017-12-02 00:53:33 +08:00
|
|
|
'code' => 'like',
|
|
|
|
'name' => 'like',
|
|
|
|
'notes' => 'like',
|
2017-06-11 07:27:19 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
public function model()
|
|
|
|
{
|
|
|
|
return Fare::class;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function findByCode($code) {
|
|
|
|
return $this->findByField('code', $code)->first();
|
|
|
|
}
|
|
|
|
}
|