feat(ISP config web and webhost imports)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 43s

This commit is contained in:
2025-12-31 11:21:20 +01:00
parent 54f056ca5f
commit fb6c62f19c
11 changed files with 704 additions and 147 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models;
use App\Enums\IspconfigType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class IspconfigMember extends Model
{
protected $table = 'ispconfigs_members';
protected $fillable = [
'member_id',
'ispconfig_client_id',
'ispconfig_service_user_id',
'email',
'type',
'data',
];
protected $casts = [
'type' => IspconfigType::class,
'data' => 'array',
];
public function member(): BelongsTo
{
return $this->belongsTo(Member::class);
}
}

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use App\Enums\IspconfigType;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -122,4 +123,23 @@ class Member extends Model
{
return $this->hasMany(Membership::class);
}
public function ispconfigs(): HasMany
{
return $this->hasMany(IspconfigMember::class, 'member_id');
}
public function ispconfigMail(): ?IspconfigMember
{
return $this->ispconfigs()
->where('type', IspconfigType::MAIL)
->first();
}
public function ispconfigWeb(): ?IspconfigMember
{
return $this->ispconfigs()
->where('type', IspconfigType::WEB)
->first();
}
}