<?php
/**
 * Model object generated by: Skipper (http://www.skipper18.com)
 * Do not modify this file manually.
 */

namespace App\Models\AbstractModels;

abstract class AbstractOperatore extends \Illuminate\Foundation\Auth\User
{
    /**  
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'operatore';
    
    /**  
     * Primary key type.
     * 
     * @var string
     */
    protected $keyType = 'bigInteger';
    
    /**  
     * The model's default values for attributes.
     * 
     * @var array
     */
    // protected $attributes = ['is_gruppo' => 0];
    
    /**  
     * The attributes that should be cast to native types.
     * 
     * @var array
     */
    protected $casts = [
        'attivita_id' => 'integer',
        'id' => 'integer',
        'nome' => 'string',
        'cognome' => 'string',
        'email' => 'string',
        'fcm_token' => 'string',
        'username' => 'string',
        'password' => 'string',
        'changed_password' => 'boolean',
        'telefono' => 'string',
        'is_attivo' => 'boolean',
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
   
    ];
    
    /**  
     * The attributes that are mass assignable.
     * 
     * @var array
     */
    protected $fillable = [
        'attivita_id',
        'id',
        'nome',
        'cognome',
        'email',
        'fcm_token',
        'username',
        'telefono',
        'password',
        'changed_password',
        'telefono',
        'is_attivo',
        'created_at',
        'updated_at'
    ];
    
    public function dispositivi()
    {
        return $this->belongsToMany('\App\Models\Dispositivo', 'operatore_has_dispositivo', 'operatore_id', 'dispositivo_id');
    }
}
