fixes
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
|
||||
class Application extends BaseModel
|
||||
@@ -22,6 +23,27 @@ class Application extends BaseModel
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function portsMappings(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn (string|null $portsMappings) =>
|
||||
is_null($portsMappings)
|
||||
? []
|
||||
: explode(',', $portsMappings)
|
||||
|
||||
);
|
||||
}
|
||||
public function portsExposes(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn (string|null $portsExposes) =>
|
||||
is_null($portsExposes)
|
||||
? []
|
||||
: explode(',', $portsExposes)
|
||||
|
||||
);
|
||||
}
|
||||
public function deployments()
|
||||
{
|
||||
return Activity::where('subject_id', $this->id)->where('properties->deployment_uuid', '!=', null)->orderBy('created_at', 'desc')->get();
|
||||
|
||||
Reference in New Issue
Block a user