-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create
BlockedBuild
Eloquent model (#1757)
The "blocked build" functionality currently resides entirely within the project model. This PR creates a new Eloquent model to represent the `blockbuild` table. This PR is part of our ongoing effort to migrate our SQL queries to Laravel's Eloquent ORM.
- Loading branch information
1 parent
8dec5f2
commit 5d43ab3
Showing
4 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* @property int $id | ||
* @property int $projectid | ||
* @property string $buildname | ||
* @property string $sitename | ||
* @property string $ipaddress | ||
* | ||
* @mixin Builder<BlockedBuild> | ||
*/ | ||
class BlockedBuild extends Model | ||
{ | ||
protected $table = 'blockbuild'; | ||
|
||
public $timestamps = false; | ||
|
||
protected $fillable = [ | ||
'projectid', | ||
'buildname', | ||
'sitename', | ||
'ipaddress', | ||
]; | ||
|
||
protected $casts = [ | ||
'id' => 'integer', | ||
'projectid' => 'integer', | ||
]; | ||
|
||
/** | ||
* @return BelongsTo<Project, self> | ||
*/ | ||
public function project(): BelongsTo | ||
{ | ||
return $this->belongsTo(Project::class, 'id', 'projectid'); | ||
} | ||
} |
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
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
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