master_template/app/Repositories/TeamsRepository.php
2024-06-18 11:31:51 +05:45

34 lines
714 B
PHP

<?php
namespace App\Repositories;
use App\Models\Teams;
use App\Repositories\Interface\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);
}
}