mirror of
https://github.com/Karaka-Management/oms-WarehouseManagement.git
synced 2026-02-14 05:08:40 +00:00
draft ::with() function for models
This commit is contained in:
parent
b9062cc8a0
commit
fbf05aeb06
|
|
@ -52,17 +52,17 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
if ($request->getData('ptype') === 'p') {
|
||||||
$view->setData('stocks',
|
$view->setData('stocks',
|
||||||
StockMapper::withConditional('language', $response->getLanguage())
|
StockMapper::with('language', $response->getLanguage())
|
||||||
::getBeforePivot((int) ($request->getData('id') ?? 0), limit: 25)
|
::getBeforePivot((int) ($request->getData('id') ?? 0), limit: 25)
|
||||||
);
|
);
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
} elseif ($request->getData('ptype') === 'n') {
|
||||||
$view->setData('stocks',
|
$view->setData('stocks',
|
||||||
StockMapper::withConditional('language', $response->getLanguage())
|
StockMapper::with('language', $response->getLanguage())
|
||||||
::getAfterPivot((int) ($request->getData('id') ?? 0), limit: 25)
|
::getAfterPivot((int) ($request->getData('id') ?? 0), limit: 25)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$view->setData('stocks',
|
$view->setData('stocks',
|
||||||
StockMapper::withConditional('language', $response->getLanguage())
|
StockMapper::with('language', $response->getLanguage())
|
||||||
::getAfterPivot(0, limit: 25)
|
::getAfterPivot(0, limit: 25)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -116,17 +116,17 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
if ($request->getData('ptype') === 'p') {
|
||||||
$view->setData('locations',
|
$view->setData('locations',
|
||||||
StockLocationMapper::withConditional('language', $response->getLanguage())
|
StockLocationMapper::with('language', $response->getLanguage())
|
||||||
::getBeforePivot((int) ($request->getData('id') ?? 0), limit: 25)
|
::getBeforePivot((int) ($request->getData('id') ?? 0), limit: 25)
|
||||||
);
|
);
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
} elseif ($request->getData('ptype') === 'n') {
|
||||||
$view->setData('locations',
|
$view->setData('locations',
|
||||||
StockLocationMapper::withConditional('language', $response->getLanguage())
|
StockLocationMapper::with('language', $response->getLanguage())
|
||||||
::getAfterPivot((int) ($request->getData('id') ?? 0), limit: 25)
|
::getAfterPivot((int) ($request->getData('id') ?? 0), limit: 25)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$view->setData('locations',
|
$view->setData('locations',
|
||||||
StockLocationMapper::withConditional('language', $response->getLanguage())
|
StockLocationMapper::with('language', $response->getLanguage())
|
||||||
::getAfterPivot(0, limit: 25)
|
::getAfterPivot(0, limit: 25)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user