Refactor and localize settings and resources
- Updated GeneralSettings page to include localized labels and structured sections for better organization. - Enhanced CarouselSlide, Category, Collection, and Product resources with localized model labels and improved form/table configurations. - Modified HomeController to utilize query builder for better performance and added collection items retrieval. - Updated views to reflect localized settings and improved layout for collections and footer. - Adjusted timezone and locale settings in app configuration for better regional support.
This commit is contained in:
@@ -13,10 +13,12 @@ class HomeController extends Controller
|
||||
{
|
||||
public function __invoke(GeneralSettings $settings)
|
||||
{
|
||||
$slides = CarouselSlide::where('is_active', true)->orderBy('order')->get();
|
||||
$collections = Collection::where('is_active', true)->orderBy('order')->get();
|
||||
$categories = Category::orderBy('order')->get();
|
||||
$products = Product::with('category')->where('is_active', true)->get();
|
||||
$slides = CarouselSlide::query()->where('is_active', true)->orderBy('order')->get();
|
||||
$collections = Collection::with(['collectionItems' => function ($query) {
|
||||
$query->where('is_active', true)->orderBy('order');
|
||||
}])->where('is_active', true)->orderBy('order')->get();
|
||||
$categories = Category::query()->orderBy('order')->get();
|
||||
$products = Product::query()->with('category')->where('is_active', true)->get();
|
||||
|
||||
return view('home', compact('slides', 'collections', 'categories', 'products', 'settings'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user