Skip to content

Commit 8149ee7

Browse files
fix saison et jour max
1 parent 9ebe1e6 commit 8149ee7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

InstaRepas/app/Http/Controllers/MealController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function generate(Request $request)
2525
// Récupération des restrictions àN partir de la requête
2626
$this->restrictions = $request->input('restrictions', []);
2727
$include_snacks = $request->input('include_snacks', false);
28-
$days = max(1, min($request->input('days', 1), 60));
28+
$days = max(1, min($request->input('days', 1), 15));
2929
$currentMonth = Carbon::now()->month;
3030
$currentSeason = null;
3131
$availableDietaryRestrictions = DietaryRestriction::all();

InstaRepas/app/Models/Season.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,18 @@ public function foods()
2424

2525
public static function getSeasonByMonth($month)
2626
{
27-
2827
$season = null;
2928
if ($month >= 3 && $month <= 5) {
3029
$season = 'Spring';
3130
} elseif ($month >= 6 && $month <= 8) {
3231
$season = 'Summer';
3332
} elseif ($month >= 9 && $month <= 11) {
34-
$season = 'Fall';
33+
$season = 'Autumn';
3534
} else {
3635
$season = 'Winter';
3736
}
38-
39-
37+
4038
return self::where('season_name', $season)->first();
4139
}
40+
4241
}

0 commit comments

Comments
 (0)