You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
746 B
35 lines
746 B
<?php
|
|
|
|
namespace App\Entities\Partners;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Vendor extends Model
|
|
{
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = ['name', 'notes', 'website', 'is_active'];
|
|
|
|
/**
|
|
* Vendor has many payments relation.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
|
*/
|
|
public function payments()
|
|
{
|
|
return $this->morphMany('App\Entities\Payments\Payment', 'partner')->orderBy('date');
|
|
}
|
|
|
|
/**
|
|
* Get status attribute.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getStatusAttribute()
|
|
{
|
|
return $this->is_active == 1 ? __('app.active') : __('app.in_active');
|
|
}
|
|
}
|