fixed item default picture after #29 change

This commit is contained in:
denisdulici 2017-09-29 23:41:28 +03:00
parent 55b09c9741
commit 3574c60469
2 changed files with 1 additions and 13 deletions

View File

@ -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;

View File

@ -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>