mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Get an object instead of a collection
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
f08ce34036
commit
f13c1a53ef
|
@ -574,8 +574,8 @@ class AssetsController extends Controller
|
||||||
$asset = $request->handleImages($asset);
|
$asset = $request->handleImages($asset);
|
||||||
|
|
||||||
// Update custom fields in the database.
|
// Update custom fields in the database.
|
||||||
// Validation for these fields is handled through the AssetRequest form request
|
// Sometimes people send arrays to this. They shouldn't, but they do, so we use "first()" to get the first match
|
||||||
$model = AssetModel::find($request->get('model_id'));
|
$model = AssetModel::where('id', '=', $request->get('model_id'))->first();
|
||||||
|
|
||||||
if (($model) && ($model->fieldset)) {
|
if (($model) && ($model->fieldset)) {
|
||||||
foreach ($model->fieldset->fields as $field) {
|
foreach ($model->fieldset->fields as $field) {
|
||||||
|
|
Loading…
Reference in a new issue