StocksNew/Modules/Stock/app/Repositories/StockLocationRepository.php

47 lines
1.0 KiB
PHP
Raw Normal View History

2024-09-11 06:47:15 +00:00
<?php
namespace Modules\Stock\Repositories;
use Modules\Stock\Models\StockLocation;
class StockLocationRepository implements StockLocationInterface
{
public function findAll()
{
return StockLocation::when(true, function ($query) {
})->paginate(20);
}
public function getStockLocationById($StockLocationId)
{
return StockLocation::findOrFail($StockLocationId);
}
public function getStockLocationByEmail($email)
{
return StockLocation::where('email', $email)->first();
}
public function delete($StockLocationId)
{
StockLocation::destroy($StockLocationId);
}
public function create($StockLocationDetails)
{
return StockLocation::create($StockLocationDetails);
}
public function update($StockLocationId, array $newDetails)
{
return StockLocation::whereId($StockLocationId)->update($newDetails);
}
public function pluck()
{
return StockLocation::pluck('title', 'id');
}
}