master_template/app/Repositories/EconomyRepository.php
2024-06-15 22:23:54 +05:45

35 lines
702 B
PHP

<?php
namespace App\Repositories;
use App\Models\Economies;
use App\Repositories\Interface\EconomyInterface;
class EconomyRepository implements EconomyInterface
{
public function getAll()
{
return Economies::where('status','<>', -1)->orderBy('display_order')->get();
}
public function getId($id)
{
return Economies::findOrFail($id);
}
public function delete($id)
{
return Economies::destroy($id);
}
public function create(array $Details)
{
return Economies::create($Details);
}
public function update($id, array $newDetails){
return Economies::where('economy_id', $id)->update($newDetails);
}
}