2017-06-11 07:27:19 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Interfaces\Repository;
|
2017-06-11 07:27:19 +08:00
|
|
|
use App\Models\Fare;
|
2017-12-02 00:53:33 +08:00
|
|
|
use Prettus\Repository\Contracts\CacheableInterface;
|
2018-02-21 12:33:09 +08:00
|
|
|
use Prettus\Repository\Traits\CacheableRepository;
|
2017-06-11 07:27:19 +08:00
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
/**
|
|
|
|
* Class FareRepository
|
|
|
|
* @package App\Repositories
|
|
|
|
*/
|
|
|
|
class FareRepository extends Repository 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 = [
|
2018-03-20 09:50:40 +08:00
|
|
|
'code' => 'like',
|
|
|
|
'name' => 'like',
|
2017-12-02 00:53:33 +08:00
|
|
|
'notes' => 'like',
|
2017-06-11 07:27:19 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
public function model()
|
|
|
|
{
|
|
|
|
return Fare::class;
|
|
|
|
}
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
public function findByCode($code)
|
|
|
|
{
|
2017-06-11 07:27:19 +08:00
|
|
|
return $this->findByField('code', $code)->first();
|
|
|
|
}
|
|
|
|
}
|