This repository has been archived on 2022-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
socialtree-laravel/src/app/Http/Controllers/SocialTreePageController.php

33 lines
811 B
PHP

<?php
namespace App\Http\Controllers;
use App\Services\SocialTreePageService;
use Illuminate\Http\Request;
use Illuminate\View\View;
class SocialTreePageController extends Controller
{
private $socialTreePageService;
public function __construct()
{
$this->socialTreePageService = new SocialTreePageService();
}
public function index(): view
{
$links = $this->socialTreePageService->getLinks();
$config = $this->socialTreePageService->getConfig()[0];
$username = $config['username'];
$theme = $config['theme'];
return view('app',[
'title' => $username . 's LinkTree',
'username' => $username,
'links' => $links,
'theme' => $theme,
'content' => 'linkpage'
]);
}
}