<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * @property mixed id
 */
class Demand extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable = [
        'name','phone','email','gender','age','date_of_birth','national_id','nationality','marital','district','study_level','words_work_experience','goal_year','work_experience','subject_training_session','training_session','pros_cons','social_problem','volunteered','attend_programs_training','courses_nesma','know_nesma_training','cv','course_id','user_id'
    ];
    public function course()
    {
        return $this->belongsTo(Product::class,'course_id')->withTrashed();
    }
    public function user()
    {
        return $this->belongsTo(User::class)->withTrashed();
    }
    public function processes()
    {
        return $this->belongsToMany(Choise::class,'demand_processes','demand_id','process_id');
    }
}
