40 lines
754 B
PHP
40 lines
754 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ProjectModule extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'project_id',
|
|
'title',
|
|
'description',
|
|
'weight_percent',
|
|
'status',
|
|
'start_date',
|
|
'end_date',
|
|
'order',
|
|
];
|
|
|
|
protected $casts = [
|
|
'start_date' => 'date',
|
|
'end_date' => 'date',
|
|
'weight_percent' => 'integer',
|
|
'order' => 'integer',
|
|
];
|
|
|
|
public function project()
|
|
{
|
|
return $this->belongsTo(Project::class);
|
|
}
|
|
|
|
public function tasks()
|
|
{
|
|
return $this->hasMany(ProjectTask::class, 'project_module_id');
|
|
}
|
|
}
|