Reversed order of find

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2023-10-09 16:43:14 +01:00
parent e3591dc756
commit f685ba01b6
6 changed files with 11 additions and 6 deletions
@@ -146,7 +146,7 @@ class AccessoriesFilesController extends Controller
$this->authorize('view', $accessory);
$this->authorize('accessories.files', $accessory);
if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $accessory->id)->first()) {
if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $accessory->id)->find($fileId)) {
return redirect()->route('accessories.index')->with('error', trans('admin/users/message.log_record_not_found'));
}