Skip to content

Commit

Permalink
Fix issue with null on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
BayuDC committed May 30, 2022
1 parent a06ab68 commit 5ef3e9d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/views/transaction/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="mb-4">
<label for="computer" class="form-label">Computer</label>
<select name="computer" id="computer" class="form-select @error('type') is-invalid @enderror">
<option selected value="{{ $transaction->computer->id }}">{{ $transaction->computer->name }}</option>
<option selected value="{{ $transaction->computer?->id }}">{{ $transaction->computer?->name }}</option>
@foreach($computers as $computer)
@if($computer->transactions->count() == 0)
<option value="{{ $computer->id }}" @if($computer->id == old('computer')) selected @endif>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/transaction/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<tr>
<th class="col-1">{{ $i + 1 }}</th>
<td>{{ $transaction->customer }}</td>
<td>{{ $transaction->computer->name }}</td>
<td>{!! $transaction->computer?->name ??'<i>Deleted</i>' !!}</td>
<td>{{ $transaction->duration }}</td>
<td>{{ $transaction['remaining_time'] }}</td>
<td class="col-1">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/transaction/index_all.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<tr>
<th class="col-1">{{ $i + $start }}</th>
<td>{{ $transaction->customer }}</td>
<td>{{ $transaction->computer->name }}</td>
<td>{!! $transaction->computer?->name ??'<i>Deleted</i>' !!}</td>
<td>{{ $transaction->duration }}</td>
<td>Rp. {{ $transaction['bill'] }}</td>
<td class="col-1">
Expand Down
4 changes: 2 additions & 2 deletions resources/views/transaction/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</tr>
<tr>
<th>Computer</th>
<td>{{ $transaction->computer->name }}</td>
<td>{!! $transaction->computer?->name ??'<i>Deleted</i>' !!}</td>
</tr>
<tr>
<th scope="row" class="">Duration</th>
Expand Down Expand Up @@ -71,7 +71,7 @@
</tr>
<tr>
<th>Added By</th>
<td>{{ $transaction->operator->fullname }}</td>
<td>{!! $transaction->operator?->fullname ?? '<i>Deleted</i>' !!}</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 5ef3e9d

Please sign in to comment.