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

namespace App\Models\AbstractModels;

abstract class AbstractTesti extends \Illuminate\Foundation\Auth\User
{
    /**  
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'testi';
    
    /**  
     * 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 = [
        'id' => 'integer',
        'attivita_id' => 'integer',
        'user_id' => 'integer',
        'titolo' => 'string',
        'descrizione' => 'string',
        'testo' => 'string',
        'ambiente' => 'string',
        'tipo' => 'string',
        'is_attivo' => 'boolean',
        'created_at' => 'datetime',
        'updated_at' => 'datetime'
    ];
    
    /**  
     * The attributes that are mass assignable.
     * 
     * @var array
     */
    protected $fillable = [
        'id',
        'attivita_id',
        'user_id',
        'titolo',
        'descrizione',
        'testo',
        'ambiente',
        'tipo',
        'is_attivo',
        'created_at',
        'updated_at'
    ];
    
    public function attivita()
    {
        return $this->belongsTo('\App\Models\Attivita', 'attivita_id', 'id');
    }

    public function user()
    {
        return $this->belongsTo('\App\Models\User', 'user_id', 'id');
    }
}
