Skip to content

Commit

Permalink
Update: Rename year to name in Year resources
Browse files Browse the repository at this point in the history
  • Loading branch information
3m1n3nc3 committed Oct 7, 2024
1 parent 1c43f0b commit feb9bf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Vehicles/VehicleYearController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function index(Request $request)
if ($request->boolean('distinct')) {
$list = $query
->where('year_from', '!=', '')
->select(['vehicle_years.id', 'year_from as year'])
->select(['vehicle_years.id', 'year_from as name'])
->groupBy(['year_from'])
->orderBy('year_from')
->paginate($request->input('limit', 50));
Expand Down Expand Up @@ -72,7 +72,7 @@ public function countryIndex(Request $request, VehicleCountry $country)
if ($request->boolean('distinct')) {
$list = $query
->where('year_from', '!=', '')
->select(['vehicle_years.id', 'year_from as year'])
->select(['vehicle_years.id', 'year_from as name'])
->groupBy(['year_from'])
->orderBy('year_from')
->paginate($request->input('limit', 50));
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/Vehicles/YearResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function toArray(Request $request): array
{
return [
'id' => $this->id,
'year' => $this->year_from,
'name' => $this->year_from,
'period' => join(' - ', [$this->year_from, $this->year_to]),
'year_from' => $this->year_from,
'year_to' => $this->year_to,
Expand Down

0 comments on commit feb9bf4

Please sign in to comment.