Created
January 13, 2021 21:16
-
-
Save morrislaptop/969d0376ed90f14119bf5078ef89e8e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 App\Models; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* @property int $id | |
* @property int $project_id | |
* @property string $sha | |
* @property string $message | |
* @property string $ref | |
* @property \Carbon\Carbon $committed_at | |
* @property \Carbon\Carbon $build_started_at | |
* @property \Carbon\Carbon $build_finished_at | |
* @property string $output | |
* @property string $status | |
* @property \Carbon\Carbon $created_at | |
* @property \Carbon\Carbon $updated_at | |
*/ | |
class Build extends Model | |
{ | |
use HasFactory, BuildBehaviour; | |
/** | |
* The attributes that are mass assignable. | |
* | |
* @var array | |
*/ | |
protected $fillable = [ | |
'project_id', | |
'sha', | |
'message', | |
'ref', | |
'committed_at', | |
'build_started_at', | |
'build_finished_at', | |
'output', | |
'status', | |
]; | |
/** | |
* The attributes that should be cast to native types. | |
* | |
* @var array | |
*/ | |
protected $casts = [ | |
'id' => 'integer', | |
'project_id' => 'integer', | |
'committed_at' => 'datetime', | |
'build_started_at' => 'datetime', | |
'build_finished_at' => 'datetime', | |
]; | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\HasMany | |
*/ | |
public function templates() | |
{ | |
return $this->hasMany(\App\Models\Template::class); | |
} | |
/** | |
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | |
*/ | |
public function project() | |
{ | |
return $this->belongsTo(\App\Models\Project::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment