<?php
namespace App\Repositories;
use App\Models\Posts;
use App\Repositories\BaseRepository;
class PostsRepository extends BaseRepository
{
protected $fieldSearchable = [
'title',
'content',
'image_chaption',
'highlight',
'slug',
'post_category_id',
'user_id'
];
public function getFieldsSearchable(): array
{
return $this->fieldSearchable;
}
public function model(): string
{
return Posts::class;
}
public function findBySlug($slug)
{
return Posts::where('slug', $slug)->first();
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]