Navigation, routes

This commit is contained in:
Alexander Yakovlev 2022-08-09 15:29:22 +07:00
parent a9cf10a6c3
commit 2108ea38e0
Signed by: oreolek
GPG key ID: 8D24103F5EE2A6C0
2 changed files with 20 additions and 18 deletions

View file

@ -46,30 +46,32 @@ class GenericView {
'link' => 'page/view/1',
],
);
if (!$this->is_admin)
if (!Auth::user())
{
$navigation[] = [
'text' => 'Вход',
'link' => 'user/signin',
'link' => route('login'),
];
}
else
{
$navigation = array_merge($navigation, array(
[
'text' => 'Комментарии',
'link' => 'comment/index',
],
[
'text' => 'Черновики страниц',
'link' => 'page/drafts',
],
[
'text' => 'Заметки',
'link' => 'note/index',
],
));
$drop_links['Черновики дневника'] = 'post/drafts';
if ($this->is_admin) {
$navigation = array_merge($navigation, array(
[
'text' => 'Комментарии',
'link' => 'comment/index',
],
[
'text' => 'Черновики страниц',
'link' => 'page/drafts',
],
[
'text' => 'Заметки',
'link' => 'note/index',
],
));
$drop_links['Черновики дневника'] = 'post/drafts';
}
}
$dropdown = array(
'name' => 'Дневник',

View file

@ -16,6 +16,7 @@ use App\Http\Controllers\CommentController;
|
*/
require __DIR__.'/auth.php';
Route::get('/', [PostController::class, 'read']);
Route::get('/Post/read', [PostController::class, 'read'])->name('default');
Route::any('/Post/read/page/{page}', [PostController::class, 'read']);
@ -30,4 +31,3 @@ Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth'])->name('dashboard');
require __DIR__.'/auth.php';