<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Promotion extends Model
{
    //
	use SoftDeletes;

	const FROM_OWNER = 1;
	const FROM_ITRO = 2;

	protected $fillable = [
		'user_id',
		'start_date',
		'end_date',
		'title',
		'desc',
		'from',
	];

	protected $dates = [
		'created_at',
		'updated_at',
		'deleted_at'
	];

	public function hostels()
	{
		return $this->belongsToMany(Promotion::class, 'hostel_promotions', 'promotion_id', 'hostel_id');
	}
}
