StocksNew/Modules/Stock/app/Repositories/StockLocationRepository.php
Sampanna Rimal afb2c202d6 changes
2024-09-11 12:32:15 +05:45

47 lines
1.0 KiB
PHP

<?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');
}
}