Skip to content

Commit

Permalink
Drop lts from API
Browse files Browse the repository at this point in the history
  • Loading branch information
driftingly committed Apr 26, 2023
1 parent 10b12e6 commit 3033043
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ https://laravelversions.com/api/versions
"latest_minor":47,
"latest_patch":0,
"latest":"9.47.0",
"is_lts":false,
"released_at":"2022-02-08T00:00:00.000000Z",
"ends_bugfixes_at":"2023-08-08T00:00:00.000000Z",
"ends_securityfixes_at":"2024-02-08T00:00:00.000000Z",
Expand All @@ -36,7 +35,6 @@ https://laravelversions.com/api/versions
],
"global":{
"latest_version":"9.47.0",
"latest_version_is_lts":false
}
},
{}
Expand All @@ -61,7 +59,6 @@ If you request a minor/patch version (e.g. `/8.1` or `/8.1.0`) you'll see an add
"latest_minor": 24,
"latest_patch": 0,
"latest": "8.24.0",
"is_lts": false,
"released_at": "2020-09-08T00:00:00.000000Z",
"ends_bugfixes_at": "2021-04-21T00:00:00.000000Z",
"ends_securityfixes_at": "2021-09-08T00:00:00.000000Z",
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Resources/LaravelVersionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function toArray($request): array
$minor_label => $this->last->minor,
'latest_patch' => $this->last->patch,
'latest' => $this->last->semver,
'is_lts' => $this->is_lts,
'released_at' => $this->released_at,
'ends_bugfixes_at' => $this->ends_bugfixes_at,
'ends_securityfixes_at' => $this->ends_securityfixes_at,
Expand All @@ -33,7 +32,6 @@ public function toArray($request): array
'links' => $this->links($request),
'global' => [
'latest_version' => (string) $latest_version,
'latest_version_is_lts' => $latest_version->is_lts,
],
];
}
Expand Down
1 change: 0 additions & 1 deletion app/Models/LaravelVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class LaravelVersion extends Model
'released_at' => 'date',
'ends_bugfixes_at' => 'date',
'ends_securityfixes_at' => 'date',
'is_lts' => 'bool',
];

public static function notificationDays()
Expand Down
1 change: 0 additions & 1 deletion database/factories/LaravelVersionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function definition(): array
'major' => $semver->major,
'minor' => $semver->minor,
'patch' => $semver->patch,
'is_lts' => false,
'changelog' => null,
'released_at' => $released_at,
'ends_bugfixes_at' => $released_at->clone()->addYear(),
Expand Down
22 changes: 22 additions & 0 deletions database/migrations/2023_04_18_203851_drop_column_is_lts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up()
{
Schema::table('laravel_versions', function (Blueprint $table) {
$table->dropColumn('is_lts');
});
}

public function down()
{
Schema::table('laravel_versions', function (Blueprint $table) {
$table->boolean('is_lts')->default(false);
});
}
};
3 changes: 0 additions & 3 deletions database/seeders/LaravelVersionSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function versions(): Collection
'released_at' => '2019-09-03',
'ends_bugfixes_at' => '2021-09-07',
'ends_securityfixes_at' => '2022-09-06',
'is_lts' => true,
],
[
'major' => 5,
Expand Down Expand Up @@ -76,7 +75,6 @@ public function versions(): Collection
'released_at' => '2017-08-30',
'ends_bugfixes_at' => '2019-08-30',
'ends_securityfixes_at' => '2020-08-30',
'is_lts' => true,
],
[
'major' => 5,
Expand Down Expand Up @@ -105,7 +103,6 @@ public function versions(): Collection
'released_at' => '2015-06-09',
'ends_bugfixes_at' => '2017-06-09',
'ends_securityfixes_at' => '2018-06-09',
'is_lts' => true,
],
[
'major' => 5,
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/ApiShowVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public function it_loads_latest_version(): void
$this->getJson($older->api_url)
->assertJsonFragment([
'latest_version' => $newest->semver,
'latest_version_is_lts' => $newest->is_lts,
]);
}
}

0 comments on commit 3033043

Please sign in to comment.