Files
monica/app/Models/Template.php
T

43 lines
860 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Template extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'account_id', 'name',
];
/**
* Get the account associated with the template.
*
* @return BelongsTo
*/
public function account()
{
return $this->belongsTo(Account::class);
}
/**
* Get the information values associated with the template.
*
* @return BelongsToMany
*/
public function informations()
{
return $this->belongsToMany(Information::class);
}
}