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-03-03 20:48:22 +01:00
|
|
|
use Illuminate\Http\Request;
|
2024-03-01 20:34:36 +01:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2024-03-03 20:48:22 +01:00
|
|
|
public function start(Request $request)
|
2024-02-29 20:00:59 +01:00
|
|
|
{
|
2024-03-02 01:16:24 +01:00
|
|
|
return view('back.start', [
|
2024-03-03 20:48:22 +01:00
|
|
|
"status" => (session('handle') !== null ? true : false),
|
2024-03-02 01:16:24 +01:00
|
|
|
"title" => "Fipamo Dash"
|
|
|
|
]);
|
2024-02-29 20:00:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|