Files
construprogress/app/Models/Layer.php
T

36 lines
677 B
PHP
Raw Normal View History

2026-05-07 23:31:33 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Layer extends Model
{
protected $fillable = [
'project_id', 'phase_id', 'name', 'color', 'geojson_data', 'original_file', 'uploaded_by'
2026-05-07 23:31:33 +02:00
];
protected $casts = [
'geojson_data' => 'array',
];
public function project()
{
return $this->belongsTo(Project::class);
}
public function phase()
{
return $this->belongsTo(Phase::class);
}
public function uploader()
{
return $this->belongsTo(User::class, 'uploaded_by');
}
public function features()
{
return $this->hasMany(Feature::class);
}
}