Company logo added media manager
This commit is contained in:
@ -7,10 +7,11 @@ use EloquentFilter\Filterable;
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Kyslik\ColumnSortable\Sortable;
|
||||
use Plank\Mediable\Mediable;
|
||||
|
||||
class Company extends Eloquent
|
||||
{
|
||||
use Filterable, SoftDeletes, Sortable;
|
||||
use Filterable, SoftDeletes, Sortable, Mediable;
|
||||
|
||||
protected $table = 'companies';
|
||||
|
||||
@ -229,4 +230,18 @@ class Company extends Eloquent
|
||||
->orderBy('value', $direction)
|
||||
->select('companies.*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current balance.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogoAttribute()
|
||||
{
|
||||
if (!$this->hasMedia('logo')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->getMedia('logo')->last();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user