/RunParticipation.php Secret
Created
March 11, 2019 09:47
-
-
Save tsh-code/d54ae48e4a23c2be3aeefade6f0af0fe to your computer and use it in GitHub Desktop.
Eloquent run participation model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Infrastructure\Eloquent\Model; | |
use Illuminate\Database\Eloquent\Model; | |
class RunParticipation extends Model | |
{ | |
/** | |
* The attributes that are mass assignable. | |
* | |
* @var array | |
*/ | |
protected $fillable = [ | |
'runner_id', | |
'run_id', | |
]; | |
/** | |
* @var string | |
*/ | |
protected $table = 'run_participations'; | |
/** | |
* @var string | |
*/ | |
protected $keyType = 'string'; | |
/** | |
* @var bool | |
*/ | |
public $timestamps = false; | |
/** | |
* @var bool | |
*/ | |
public $incrementing = false; | |
public function runner() | |
{ | |
return $this->belongsTo(Runner::class); | |
} | |
public function run() | |
{ | |
return $this->belongsTo(Run::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment