2024-02-29 20:00:59 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2024-03-01 20:34:36 +01:00
|
|
|
use App\Services\SettingsService;
|
|
|
|
use App\Services\AuthService;
|
|
|
|
|
2024-02-29 20:00:59 +01:00
|
|
|
class DashController extends Controller
|
|
|
|
{
|
2024-03-01 20:34:36 +01:00
|
|
|
protected $files = [];
|
|
|
|
protected $settings;
|
|
|
|
protected $auth;
|
2024-02-29 20:00:59 +01:00
|
|
|
|
2024-03-01 20:34:36 +01:00
|
|
|
public function __construct(
|
|
|
|
SettingsService $settingsService,
|
|
|
|
AuthService $authService
|
|
|
|
) {
|
|
|
|
$this->read(env('PAGES_PATH'));
|
|
|
|
$this->settings = $settingsService;
|
|
|
|
$this->auth = $authService;
|
2024-02-29 20:00:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function start()
|
|
|
|
{
|
|
|
|
return view('back.start', []);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function read($folder)
|
|
|
|
{
|
|
|
|
$folders = glob("$folder/*", GLOB_ONLYDIR);
|
|
|
|
foreach ($folders as $folder) {
|
|
|
|
//$this->files[] = $folder . "/";
|
|
|
|
$this->read($folder);
|
|
|
|
}
|
|
|
|
$files = array_filter(glob("$folder/*md"), 'is_file');
|
|
|
|
foreach ($files as $file) {
|
|
|
|
$this->files[] = $file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|