Replaced Moment with Carbon #84

Merged
Ghost merged 148 commits from develop into beta 2022-09-22 05:53:36 +02:00
5 changed files with 19 additions and 28 deletions
Showing only changes of commit 7f1654d13b - Show all commits

View file

@ -1,9 +1,8 @@
<?php
namespace App\Http\Controllers\Dash;
namespace App\Http\Controllers;
use Symfony\Component\HttpFoundation\Response;
use App\Http\Controllers\Controller;
use App\Services\AuthService;
use Illuminate\Http\Request;

View file

@ -1,14 +1,13 @@
<?php
namespace App\Http\Controllers\Dash;
namespace App\Http\Controllers;
use App\Interfaces\PageRepositoryInterface;
use App\Services\AuthService;
use App\Services\ThemeService;
use App\Services\SortingService;
use App\Http\Controllers\Controller;
class IndexController extends Controller
class DashController extends Controller
{
protected PageRepositoryInterface $pages;
protected AuthService $auth;
@ -45,12 +44,10 @@ class IndexController extends Controller
return $this->page($third, $fourth);
break;
case 'logout':
session()->flush();
return redirect()->intended('dashboard');
return $this->logout();
break;
default:
return $this->start();
break;
}
}
@ -58,7 +55,7 @@ class IndexController extends Controller
public function login()
{
if ($this->auth::status()) {
return redirect('dashboard/start');
return redirect('dashboard');
} else {
return view('back.login', [
"status" => $this->auth::status(),
@ -121,4 +118,10 @@ class IndexController extends Controller
{
return view('back.settings', $this->sort->settings());
}
public function logout()
{
session()->flush();
return redirect()->intended('dashboard');
}
}

View file

@ -1,9 +1,8 @@
<?php
namespace App\Http\Controllers\Front;
namespace App\Http\Controllers;
use App\Services\SettingsService;
use App\Http\Controllers\Controller;
use App\Services\AuthService;
use App\Interfaces\PageRepositoryInterface;
use App\Services\SortingService;
@ -11,7 +10,7 @@ use App\Services\AssetService;
use function _\find;
class StartController extends Controller
class FrontController extends Controller
{
protected $settings;
protected $auth;

View file

@ -2,10 +2,6 @@
namespace App\Http\Controllers;
use App\Http\Controllers\Dash\IndexController;
use App\Http\Controllers\Dash\AuthController;
use App\Http\Controllers\Front\StartController;
use App\Http\Controllers\Theming\ThemeController;
use App\Services\AuthService;
use Illuminate\Http\Request;
@ -18,16 +14,16 @@ class RouteController extends Controller
protected $auth;
public function __construct(
IndexController $indexController,
DashController $dashController,
AuthController $authController,
ThemeController $themeController,
StartController $startContoller,
FrontController $frontController,
AuthService $authService,
) {
$this->dash = $indexController;
$this->dash = $dashController;
$this->gate = $authController;
$this->theme = $themeController;
$this->front = $startContoller;
$this->front = $frontController;
$this->auth = $authService;
}
@ -37,11 +33,7 @@ class RouteController extends Controller
switch ($first) {
case 'dashboard':
if ($this->auth::status()) {
if (isset($second)) {
return $this->dash->init($second, $third, $fourth);
} else {
return $this->dash->start();
}
return $this->dash->init($second, $third, $fourth);
} else {
return $this->dash->login();
}
@ -56,7 +48,6 @@ class RouteController extends Controller
} else {
return $this->dash->login();
}
break;
case 'tags':
case 'archives':

View file

@ -1,8 +1,7 @@
<?php
namespace App\Http\Controllers\Theming;
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Interfaces\PageRepositoryInterface;
use App\Services\AuthService;
use App\Services\SortingService;