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
@@ -137,7 +137,7 @@ class LicenseFilesController extends Controller
$this->authorize('view', $license);
$this->authorize('licenses.files', $license);
if (! $log = Actionlog::find($fileId)->whereNotNull('filename')->where('item_id', $license->id)->first()) {
if (! $log = Actionlog::whereNotNull('filename')->where('item_id', $license->id)->find($fileId)) {
return response('No matching record for that asset/file', 500)
->header('Content-Type', 'text/plain');
}