This commit is contained in:
tanch0
2024-06-15 22:23:54 +05:45
parent 8253440371
commit cb99bedac6
144 changed files with 6436 additions and 3112 deletions

View File

@ -0,0 +1,34 @@
<?php
namespace App\Repositories;
use App\Repositories\Interface\AuthorsInterface;
use App\Models\Authors;
class AuthorRepository implements AuthorsInterface
{
public function getAll()
{
return Authors::where('status', '<>', -1)->orderBy('display_order')->get();
}
public function getAuthorsById($authorId)
{
return Authors::findOrFail($authorId);
}
public function delete($authorId)
{
return Authors::destroy($authorId);
}
public function create(array $authorDetail)
{
return Authors::create($authorDetail);
}
public function update($authorId, array $newDetails)
{
return Authors::where('author_id', $authorId)->update($newDetails);
}
}