mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 23:16:52 -04:00
73 lines
1.7 KiB
PHP
73 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace Modules\Frontend\Http\Controllers;
|
|
|
|
use Illuminate\Contracts\Support\Renderable;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Routing\Controller;
|
|
use Modules\Frontend\Entities\Creator;
|
|
use Modules\Frontend\Entities\FeaturedCreator;
|
|
use Modules\Frontend\Repositories\SectionRepository;
|
|
use Modules\Frontend\Services\Creators;
|
|
use Modules\Frontend\Services\Settings;
|
|
|
|
class FrontendController extends Controller
|
|
{
|
|
protected $settings;
|
|
protected $creators;
|
|
protected $sections;
|
|
|
|
public function __construct() {
|
|
$this->settings = new Settings();
|
|
$this->creators = new Creators();
|
|
$this->sections = new SectionRepository();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$heroVideo = $this->settings->getValue('hero-video');
|
|
$creators = $this->creators->getFeatured();
|
|
$sections = $this->sections->all();
|
|
|
|
return view('frontend::index', compact('heroVideo', 'creators', 'sections'));
|
|
}
|
|
|
|
public function manager()
|
|
{
|
|
return view('frontend::manager');
|
|
}
|
|
|
|
public function video()
|
|
{
|
|
return view('frontend::video');
|
|
}
|
|
|
|
public function creators()
|
|
{
|
|
$creators = $this->creators->all();
|
|
|
|
return response()->json([
|
|
'creators' => $creators,
|
|
]);
|
|
}
|
|
|
|
public function featuredCreators()
|
|
{
|
|
$creators = $this->creators->getFeatured();
|
|
|
|
return response()->json([
|
|
'creators' => $creators,
|
|
]);
|
|
}
|
|
|
|
public function updateFeaturedCreators(Request $request)
|
|
{
|
|
$creators = $request->items;
|
|
$this->creators->updateFeatured($creators);
|
|
|
|
return response()->json([
|
|
'message' => __('frontend::common.featured-creators-updated'),
|
|
]);
|
|
}
|
|
}
|