fix: get envs before sortby

This commit is contained in:
Andras Bacsai 2024-06-24 15:20:52 +02:00
parent e5d915a7a9
commit 97aa6139ea

View File

@ -117,7 +117,7 @@ public function default_environment()
{
$default = $this->environments()->where('name', 'production')->first();
if (! $default) {
$default = $this->environments()->sortBy('created_at')->first();
$default = $this->environments()->get()->sortBy('created_at')->first();
}
return $default;