forked from projects/fipamo
ro
c77eeafb2c
Added controller to handle the login process and session management that stores information about the person that has logged in so that info is available through out the app when logged in
45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\SettingsService;
|
|
use App\Services\AuthService;
|
|
use Illuminate\Http\Request;
|
|
|
|
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(Request $request)
|
|
{
|
|
return view('back.start', [
|
|
"status" => (session('handle') !== null ? true : false),
|
|
"title" => "Fipamo Dash"
|
|
]);
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|