35 lines
731 B
PHP
35 lines
731 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Registration extends Model
|
|
{
|
|
protected $fillable = [
|
|
'event_id','player_id','type','group_id','status',
|
|
'handicap_type','handicap_value','handicap_band',
|
|
'pairing_mode','course_pref','registration_code'
|
|
];
|
|
|
|
protected $casts = [
|
|
'handicap_value' => 'decimal:1'
|
|
];
|
|
|
|
public function player(){
|
|
return $this->belongsTo(Player::class);
|
|
}
|
|
|
|
public function event(){
|
|
return $this->belongsTo(Event::class);
|
|
}
|
|
|
|
public function group(){
|
|
return $this->belongsTo(Group::class);
|
|
}
|
|
|
|
public function flightMember(){
|
|
return $this->hasOne(FlightMember::class);
|
|
}
|
|
}
|