<?php

namespace App\Http\Controllers\Shop;

use App\Http\Controllers\Controller;
use App\Repositories\Shop\Articles;
use App\Repositories\Shop\Contents;
use App\Repositories\Shop\TagGroups;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    public function index(Request $request)
    {
        $data = [
            'display_by_rows' => $request->input('by_rows') ?? false,
            'shelves' => Articles::getArticlesByHomepage(),
            'text' => Contents::getHomepage(),
            'tags' => TagGroups::getWithTagsAndCountOffers(),
            'no_filter' => true,
        ];

        return view('Shop.home', $data);
    }
}
