fixed item default picture after #29 change
This commit is contained in:
parent
55b09c9741
commit
3574c60469
@ -69,18 +69,6 @@ class Item extends Model
|
|||||||
return $this->reverseConvert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
return $this->reverseConvert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Always return a valid picture when we retrieve it
|
|
||||||
*/
|
|
||||||
public function getPictureAttribute($value)
|
|
||||||
{
|
|
||||||
if (!empty($value)) {
|
|
||||||
return $value;
|
|
||||||
} else {
|
|
||||||
return 'public/img/akaunting-logo-green.png';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function canDelete()
|
public function canDelete()
|
||||||
{
|
{
|
||||||
$error = false;
|
$error = false;
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@foreach($items as $item)
|
@foreach($items as $item)
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="{{ Storage::url($item->picture) }}" class="img-thumbnail" width="50" alt="{{ $item->name }}"></td>
|
<td><img src="{{ $item->picture ? Storage::url($item->picture) : asset('public/img/akaunting-logo-green.png') }}" class="img-thumbnail" width="50" alt="{{ $item->name }}"></td>
|
||||||
<td><a href="{{ url('items/items/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
<td><a href="{{ url('items/items/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||||
<td>{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
<td>{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||||
<td>{{ $item->quantity }}</td>
|
<td>{{ $item->quantity }}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user