Prechádzať zdrojové kódy

Make /articles take the user to the list of published articles and /articles/edit to the control panel

axkuhta 1 rok pred
rodič
commit
07c7435408
2 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  1. 3 1
      resources/views/published.blade.php
  2. 2 2
      routes/web.php

+ 3 - 1
resources/views/published.blade.php

@@ -3,6 +3,8 @@
 @section("content")
 <h1>Все публикации</h1>
 
+<p><a href="/articles/edit">Панель управления публикациями</a></p>
+
 @foreach ($rows as $row)
 	<div class="article-list-entry">
 		<div class="article-list-title">{{$row->title}}</div>
@@ -12,6 +14,6 @@
 	</div>
 @endforeach
 
-<p><a href="/article/add">Добавить публикацию</a></p>
+<br>
 
 @endsection

+ 2 - 2
routes/web.php

@@ -45,8 +45,8 @@ Route::get('/api/authors', function() { return Resources\AuthorResource::collect
 Route::get('/api/books', function() { return Resources\BookResource::collection(Models\Book::all()->load("author")); });
 
 // Публикации
-Route::get('/articles', [Controllers\ArticleController::class, 'index']);
-Route::get('/articles/full', [Controllers\ArticleController::class, 'full_index']);
+Route::get('/articles', [Controllers\ArticleController::class, 'published']);
+Route::get('/articles/edit', [Controllers\ArticleController::class, 'index']);
 Route::get('/article/add', [Controllers\ArticleController::class, 'add']);
 Route::get('/article/{article}', [Controllers\ArticleController::class, 'view']);
 Route::get('/article/{article}/delete', [Controllers\ArticleController::class, 'drop']);