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