StocksNew/Modules/Product/app/Repositories/WarehouseRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

47 lines
950 B
PHP

<?php
namespace Modules\Product\Repositories;
use Modules\Product\Models\Warehouse;
class WarehouseRepository implements WarehouseInterface
{
public function findAll()
{
return Warehouse::when(true, function ($query) {
})->paginate(20);
}
public function getWarehouseById($WarehouseId)
{
return Warehouse::findOrFail($WarehouseId);
}
public function getWarehouseByEmail($email)
{
return Warehouse::where('email', $email)->first();
}
public function delete($WarehouseId)
{
Warehouse::destroy($WarehouseId);
}
public function create($WarehouseDetails)
{
return Warehouse::create($WarehouseDetails);
}
public function update($WarehouseId, array $newDetails)
{
return Warehouse::whereId($WarehouseId)->update($newDetails);
}
public function pluck()
{
return Warehouse::pluck('title', 'id');
}
}