public function getStockFromLocation(Model $location)
{
$stock = $this->stocks()->where('location_id', $location->getKey())->first();
if ($stock) {
return $stock;
} else {
$message = Lang::get('inventory::exceptions.StockNotFoundException', ['location' => $location->getAttribute('name')]);
throw new StockNotFoundException($message);
}
}