2018-01-29 03:19:35 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Repository;
|
2018-01-29 03:19:35 +08:00
|
|
|
use App\Models\Award;
|
|
|
|
use Prettus\Repository\Contracts\CacheableInterface;
|
2018-03-18 00:35:34 +08:00
|
|
|
use Prettus\Repository\Traits\CacheableRepository;
|
2018-01-29 03:19:35 +08:00
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
/**
|
|
|
|
* Class AwardRepository
|
|
|
|
*/
|
|
|
|
class AwardRepository extends Repository implements CacheableInterface
|
2018-01-29 03:19:35 +08:00
|
|
|
{
|
|
|
|
use CacheableRepository;
|
|
|
|
|
|
|
|
protected $fieldSearchable = [
|
|
|
|
'title' => 'like',
|
|
|
|
];
|
|
|
|
|
2018-03-18 00:35:34 +08:00
|
|
|
public function model(): string
|
2018-01-29 03:19:35 +08:00
|
|
|
{
|
|
|
|
return Award::class;
|
|
|
|
}
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
public function findByTitle($title)
|
|
|
|
{
|
2018-01-29 03:19:35 +08:00
|
|
|
return $this->findByField('title', $title)->first();
|
|
|
|
}
|
|
|
|
}
|