a2172f0851
Hopefully this will result in slightly better code.
32 lines
591 B
PHP
32 lines
591 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Tag extends Model
|
|
{
|
|
/**
|
|
* The attributes that aren't mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $guarded = ['id'];
|
|
|
|
/**
|
|
* Get the account record associated with the debt.
|
|
*/
|
|
public function account()
|
|
{
|
|
return $this->belongsTo('App\Account');
|
|
}
|
|
|
|
/**
|
|
* Get the contact record associated with the debt.
|
|
*/
|
|
public function contacts()
|
|
{
|
|
return $this->belongsToMany('App\Contact')->withPivot('account_id')->withTimestamps();
|
|
}
|
|
}
|