<?php

namespace App;

use DB;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;

/**
 * App\EmailsNotify
 *
 * @property int $idemails_notify
 * @property int|null $komu iduser
 * @property int|null $id_stanice
 * @property string|null $vlozeno
 * @property int|null $vlozil iduser
 * @property int $delka_odezvy_v_minutach pocet minut ktere je potreba aspon zprava
 * @method static Builder|EmailsNotify newModelQuery()
 * @method static Builder|EmailsNotify newQuery()
 * @method static Builder|EmailsNotify query()
 * @method static Builder|EmailsNotify whereDelkaOdezvyVMinutach($value)
 * @method static Builder|EmailsNotify whereIdStanice($value)
 * @method static Builder|EmailsNotify whereIdemailsNotify($value)
 * @method static Builder|EmailsNotify whereKomu($value)
 * @method static Builder|EmailsNotify whereVlozeno($value)
 * @method static Builder|EmailsNotify whereVlozil($value)
 * @mixin Eloquent
 */
class EmailsNotify extends Model
{
    protected $table = 'emails_notify';
    protected $primaryKey = 'idemails_notify';
    protected $fillable = ['komu','id_stanice','vlozil','delka_odezvy_v_minutach'];
    public $timestamps = false;

    /**
     * @return Collection
     */
    public function getData(): Collection
    {
        return DB::table('emails_notify')
            ->join('users','users.id','=','emails_notify.komu')
            ->get(['idemails_notify','komu','id_stanice','delka_odezvy_v_minutach','name','email','name']);
    }

}


