49 lines
1.0 KiB
PHP
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');
|
|
}
|
|
}
|