forked from projects/fipamo
ro
a748b2c098
Plugged in a basic auth classs for verifying members and a setting class to retrieve site settings and return necessary info. Very bare bones to start just to get it working and prep for the additional features
41 lines
923 B
PHP
41 lines
923 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\SettingsService;
|
|
use App\Services\AuthService;
|
|
|
|
class DashController extends Controller
|
|
{
|
|
protected $files = [];
|
|
protected $settings;
|
|
protected $auth;
|
|
|
|
public function __construct(
|
|
SettingsService $settingsService,
|
|
AuthService $authService
|
|
) {
|
|
$this->read(env('PAGES_PATH'));
|
|
$this->settings = $settingsService;
|
|
$this->auth = $authService;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|