Add the withTrashed() method to requestingUser() method in CheckoutRequest model, so the view of requestable assets doesn't crash

This commit is contained in:
Ivan Nieto Vivanco 2023-07-10 16:34:00 -06:00
parent 4845a88c68
commit ec8cb1b09e
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@ class CheckoutRequest extends Model
public function requestingUser()
{
return $this->user()->first();
return $this->user()->withTrashed()->first();
}
public function requestedItem()

View file

@ -89,7 +89,7 @@
@endif
</td>
<td>
@if ($request->requestingUser())
@if ($request->requestingUser() && !$request->requestingUser()->trashed())
<a href="{{ config('app.url') }}/users/{{ $request->requestingUser()->id }}">
{{ $request->requestingUser()->present()->fullName() }}
</a>