mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-08-01 17:17:12 -04:00
58 lines
1.4 KiB
PHP
58 lines
1.4 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\Services\Creators;
|
|
use Modules\Frontend\Services\Settings;
|
|
|
|
class FrontendController extends Controller
|
|
{
|
|
public function __construct(protected Settings $settings, protected Creators $creators) {}
|
|
|
|
public function index()
|
|
{
|
|
$hero_video = $this->settings->getValue('hero-video');
|
|
$creators = $this->creators->getFeatured();
|
|
|
|
return view('frontend::index', compact('creators', 'hero_video'));
|
|
}
|
|
|
|
public function manager()
|
|
{
|
|
return view('frontend::manager');
|
|
}
|
|
|
|
public function creators()
|
|
{
|
|
$creators = $this->creators->getAll();
|
|
|
|
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'),
|
|
]);
|
|
}
|
|
}
|