Files
OnAPB-Carrere_Demartin/app/Models/QrCode.php
T
Laucha1312 90c5f85512 2
2026-06-04 15:15:23 -03:00

49 lines
1.0 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class QrCode extends Model
{
protected $table = 'qr_codes';
protected $primaryKey = 'id_qr';
public $timestamps = false;
public $incrementing = false;
protected $fillable = [
'id_qr',
'id_evento',
'id_jugador',
'tipo_qr',
'escaneos_restantes',
'creado',
'id_aficionado',
];
protected $casts = [
'id_qr' => 'string',
'id_evento' => 'string',
'id_jugador' => 'string',
'tipo_qr' => 'string',
'escaneos_restantes' => 'integer',
'creado' => 'datetime',
'id_aficionado' => 'integer',
];
public function evento()
{
return $this->belongsTo(Evento::class, 'id_evento', 'id_evento');
}
public function jugador()
{
return $this->belongsTo(Jugador::class, 'id_jugador', 'id_jugador');
}
public function aficionado()
{
return $this->belongsTo(Aficionado::class, 'id_aficionado', 'id_aficionado');
}
}