first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Http\Controllers;
use App\Models\Title;
use Auth;
use Common\Billing\Models\Product;
use Common\Core\BaseController;
class AppHomeController extends BaseController
{
public function __invoke()
{
if (
settings('homepage.type') === 'channels' ||
(Auth::check() && settings('homepage.type') === 'landingPage')
) {
return app(FallbackRouteController::class)->renderChannel(
settings('homepage.value'),
);
} else {
return $this->renderClientOrApi([
'pageName' => 'landing-page',
'data' => [
'loader' => 'landingPage',
'products' => Product::with(['permissions', 'prices'])
->limit(15)
->orderBy('position', 'asc')
->get(),
'trendingTitles' => Title::orderBy('popularity', 'desc')
->compact()
->limit(6)
->get(),
],
]);
}
}
}