Skip to content

Commit

Permalink
Add the withTrashed() method to requestingUser() method in CheckoutRe…
Browse files Browse the repository at this point in the history
…quest model, so the view of requestable assets doesn't crash
  • Loading branch information
inietov committed Jul 10, 2023
1 parent 4845a88 commit ec8cb1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Models/CheckoutRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function user()

public function requestingUser()
{
return $this->user()->first();
return $this->user()->withTrashed()->first();
}

public function requestedItem()
Expand Down
2 changes: 1 addition & 1 deletion resources/views/hardware/requested.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class="table table-striped snipe-table"
@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>
Expand Down

0 comments on commit ec8cb1b

Please sign in to comment.