fipamo/app/Http/Controllers/DashController.php
ro 2395278893
added content collector and pagination
plugged in the dash index template which required grabbing markdown
pages and converting them to data the system can use and then pagination
that is used to sort content into pages

start page now switches from login screen to index based on session, but
that might be changes so it's a bit more clean to work with middleware
2024-03-03 17:49:05 -06:00

40 lines
994 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Services\SettingsService;
use App\Services\AuthService;
use App\Services\PaginateService;
class DashController extends Controller
{
protected $settings;
protected $pages;
public function __construct(
SettingsService $settingsService,
AuthService $authService,
PaginateService $paginateService,
) {
$this->settings = $settingsService;
$this->auth = $authService;
$this->pages = $paginateService;
}
public function start(Request $request)
{
$status = session('handle') !== null ? true : false;
$result = [];
if ($status) {
$result = $this->pages->getPage(1, 4);
//var_dump($result['pages'][1]['media'][0]['type']);
}
return view('back.start', [
"status" => $status,
"result" => $result,
"title" => "Fipamo Dash"
]);
}
}