<?php

namespace App\Models;

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

use Illuminate\Database\Eloquent\Relations\HasMany;

class User extends Model
{
    protected $table = 'users';

    protected $fillable = [
        'name',
        'email',
        'state_id',
        'mobile',
        'device_type',
        'device_name',
        'device_token',
        'device_id',
        'status',
    ];

    public function state(): BelongsTo
    {
        return $this->belongsTo(State::class, 'state_id');
    }

    public function surveys(): HasMany
    {
        return $this->hasMany(SpeciesSurvey::class, 'user_id');
    }
}

