getLocale(); $translations = array_merge( Lang::get('api', [], $locale), Lang::get('settings', [], $locale) ); $galleryHeading = Setting::where('key', 'gallery_heading')->first()->value ?? 'Style Gallery'; $newImageTimespanMinutes = Setting::where('key', 'new_image_timespan_minutes')->first()->value ?? 60; // Default to 60 minutes $images = Image::all()->map(function ($image) use ($newImageTimespanMinutes) { $image->is_new = Carbon::parse($image->created_at)->diffInMinutes(Carbon::now()) <= $newImageTimespanMinutes; $image->path = 'storage/' . $image->path; return $image; }); return Inertia::render('Home', [ 'translations' => $translations, 'galleryHeading' => $galleryHeading, 'images' => $images, ]); } }