chore: unique

This commit is contained in:
David Buday 2024-12-03 22:28:03 +01:00
parent 08d46bc242
commit 0308d36e41
3 changed files with 2 additions and 7 deletions

View file

@ -8,7 +8,7 @@ use Livewire\Component;
class Create extends Component
{
#[Validate('required|string|max:255')]
#[Validate('required|string|max:255|unique:docker_registries,name')]
public string $name = '';
#[Validate('required|string')]

View file

@ -25,9 +25,4 @@ class DockerRegistry extends Model
'custom' => 'Custom Registry'
];
}
public function applications(): HasMany
{
return $this->hasMany(Application::class, 'docker_registry_id', 'id');
}
}

View file

@ -9,7 +9,7 @@ return new class extends Migration {
{
Schema::create('docker_registries', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('name')->unique();
$table->string('type'); // docker_hub, gcr, ghcr, quay, custom
$table->string('url')->nullable();
$table->string('username')->nullable();