|
|
|
@ -6,10 +6,30 @@ 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\HasMany |
|
|
|
*/ |
|
|
|
public function payments() |
|
|
|
{ |
|
|
|
return $this->hasMany('App\Entities\Payments\Payment', 'partner_id'); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Get status attribute. |
|
|
|
* |
|
|
|
* @return string |
|
|
|
*/ |
|
|
|
public function getStatusAttribute() |
|
|
|
{ |
|
|
|
return $this->is_active == 1 ? __('app.active') : __('app.in_active'); |
|
|
|
} |
|
|
|
} |