37 lines
989 B
PHP
37 lines
989 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\Links\LinksService;
|
|
use App\Services\Userdatas\UserdatasService;
|
|
use Illuminate\View\View;
|
|
|
|
class SocialTreePageController extends Controller
|
|
{
|
|
private $linksService;
|
|
private $userdatasService;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->linksService = new LinksService();
|
|
$this->userdatasService = new UserdatasService();
|
|
}
|
|
|
|
public function index(): view
|
|
{
|
|
$links = $this->linksService->getAllLinks();
|
|
$userdata = $this->userdatasService->getFirstUserdata();
|
|
$username = $userdata['username'];
|
|
$theme = $userdata['theme'];
|
|
$profilepicture = $userdata['profilepicture'];
|
|
return view('app',[
|
|
'title' => $username . 's LinkTree',
|
|
'username' => $username,
|
|
'links' => $links,
|
|
'theme' => $theme,
|
|
'profilepicture' => $profilepicture,
|
|
'content' => 'linkpage'
|
|
]);
|
|
}
|
|
}
|