|
@@ 20-28 (lines=9) @@
|
| 17 |
|
* |
| 18 |
|
* @return \Illuminate\View\View |
| 19 |
|
*/ |
| 20 |
|
public function index(): View |
| 21 |
|
{ |
| 22 |
|
$articles = Article::with('category', 'user') |
| 23 |
|
->paginate(config('xetaravel.pagination.blog.article_per_page')); |
| 24 |
|
|
| 25 |
|
$this->breadcrumbs->addCrumb('Manage Articles', route('admin.blog.article.index')); |
| 26 |
|
|
| 27 |
|
return view('Admin::Blog.article.index', ['articles' => $articles, 'breadcrumbs' => $this->breadcrumbs]); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
/** |
| 31 |
|
* Show the article create form. |
|
@@ 35-44 (lines=10) @@
|
| 32 |
|
* |
| 33 |
|
* @return \Illuminate\View\View |
| 34 |
|
*/ |
| 35 |
|
public function showCreateForm(): View |
| 36 |
|
{ |
| 37 |
|
$categories = Category::pluck('title', 'id'); |
| 38 |
|
|
| 39 |
|
$breadcrumbs = $this->breadcrumbs |
| 40 |
|
->addCrumb('Manage Articles', route('admin.blog.article.index')) |
| 41 |
|
->addCrumb("Create", route('admin.blog.article.create')); |
| 42 |
|
|
| 43 |
|
return view('Admin::Blog.article.create', ['categories' => $categories, 'breadcrumbs' => $this->breadcrumbs]); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
/** |
| 47 |
|
* Handle an article create request for the application. |