35 lines
660 B
PHP
35 lines
660 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class CustomFieldType
|
|
*/
|
|
class Template extends Model
|
|
{
|
|
public $timestamps = true;
|
|
protected $fillable = [
|
|
'template_name',
|
|
'name',
|
|
'path',
|
|
'description',
|
|
'editable'
|
|
];
|
|
protected $guarded = [];
|
|
|
|
const EDITED_TEMPLATES_DIRECTORY = 'custom';
|
|
const TEMPLATE_SUFFIX = '.blade.php';
|
|
|
|
|
|
/**
|
|
* In one path may be many templates
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function template()
|
|
{
|
|
return $this->belongsTo('App\Models\TemplatePath', 'id');
|
|
}
|
|
} |