Navigation, routes
This commit is contained in:
parent
a9cf10a6c3
commit
2108ea38e0
|
@ -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' => 'Дневник',
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue