FEATURE: change directory structure

This commit is contained in:
Michal Kváček
2016-10-17 00:07:21 +02:00
parent 87f1920373
commit 2ded2924a1
242 changed files with 742 additions and 1171 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class CustomFieldType
*/
class TemplatePath extends Model
{
public $timestamps = true;
protected $fillable = ['name', 'path', 'parent_id', 'namespace'];
protected $guarded = [];
/**
* In one path may be many templates
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function templates()
{
return $this->hasMany('App\Models\Template', 'path');
}
/**
* List of all subdirectories of given path
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function subdirectories()
{
return $this->hasMany('App\Models\TemplatePath', 'parent_id');
}
}