feat(ISP config web and webhost imports)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 43s
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 43s
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user