phpvms/app/Repositories/AwardRepository.php

26 lines
529 B
PHP
Raw Normal View History

2018-01-29 03:19:35 +08:00
<?php
namespace App\Repositories;
use App\Models\Award;
use Prettus\Repository\Contracts\CacheableInterface;
use Prettus\Repository\Traits\CacheableRepository;
2018-01-29 03:19:35 +08:00
class AwardRepository extends BaseRepository implements CacheableInterface
{
use CacheableRepository;
protected $fieldSearchable = [
'title' => 'like',
];
public function model(): string
2018-01-29 03:19:35 +08:00
{
return Award::class;
}
public function findByTitle($title) {
return $this->findByField('title', $title)->first();
}
}