master_template/app/Repositories/TeamsRepository.php
2024-06-23 17:02:56 +05:45

34 lines
704 B
PHP

<?php
namespace App\Repositories;
use App\Models\Teams;
use App\Repositories\TeamsInterface;
class TeamsRepository implements TeamsInterface
{
public function getAll()
{
return Teams::where('status','<>', -1)->orderBy('display_order')->get();
}
public function getTeamById($teamId)
{
return Teams::findOrFail($teamId);
}
public function delete($teamId)
{
return Teams::destroy($teamId);
}
public function create(array $provinceDetails)
{
return Teams::create($provinceDetails);
}
public function update($teamId, array $newDetails){
return Teams::where('team_id', $teamId)->update($newDetails);
}
}