42 lines
915 B
PHP
42 lines
915 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Actions\Git\GitProviderKey;
|
|
use Database\Factories\RepositoryConnectionFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable([
|
|
'base_url',
|
|
'owner_name',
|
|
'project_id',
|
|
'provider',
|
|
'provider_repository_id',
|
|
'repository_full_name',
|
|
'repository_name',
|
|
'repository_url',
|
|
])]
|
|
class RepositoryConnection extends Model
|
|
{
|
|
/** @use HasFactory<RepositoryConnectionFactory> */
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'provider' => GitProviderKey::class,
|
|
];
|
|
}
|
|
|
|
public function project(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Project::class);
|
|
}
|
|
}
|