first commit
This commit is contained in:
46
Modules/Product/app/Repositories/WarehouseRepository.php
Normal file
46
Modules/Product/app/Repositories/WarehouseRepository.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user