Eager load company

This commit is contained in:
Marcus Moore 2023-02-06 10:59:51 -08:00
parent 78343ddb7c
commit 38cdcdf064
No known key found for this signature in database

View file

@ -27,7 +27,7 @@ class AssetCheckoutController extends Controller
public function create($assetId)
{
// Check if the asset exists
if (is_null($asset = Asset::find(e($assetId)))) {
if (is_null($asset = Asset::with('company')->find(e($assetId)))) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.does_not_exist'));
}