<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class RoadConstructionProject extends Model
{
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'operation_sub_types' => 'array',
        'physical_progress' => 'array',
        'project_stop_reasons' => 'array'
    ];

    public function user()
    {
        return $this->belongsTo('App\Models\User');
    }

    /**
     * Get all of the project's files.
     */
    public function files()
    {
        return $this->morphMany('App\Models\ProjectFile', 'project_fileable');
    }
}
