34 lines
714 B
PHP
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);
|
|
}
|
|
}
|