2017-06-11 07:27:19 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
|
|
|
use App\Models\Fare;
|
2017-08-25 02:03:10 +08:00
|
|
|
use Prettus\Repository\Eloquent\BaseRepository;
|
|
|
|
|
2017-06-11 07:27:19 +08:00
|
|
|
|
|
|
|
class FareRepository extends BaseRepository
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $fieldSearchable = [
|
|
|
|
'code',
|
|
|
|
'name',
|
|
|
|
'price',
|
|
|
|
'cost',
|
|
|
|
'notes',
|
|
|
|
'active'
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure the Model
|
|
|
|
**/
|
|
|
|
public function model()
|
|
|
|
{
|
|
|
|
return Fare::class;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function findByCode($code) {
|
|
|
|
return $this->findByField('code', $code)->first();
|
|
|
|
}
|
|
|
|
}
|