leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') ->where('completed', 0) ->where('user_id', Auth::user()->id)->first(['transaction_journals.*']); if ($object) { return $object; } } throw new NotFoundHttpException; } }