|
1
|
|
|
<?php |
|
2
|
|
|
namespace Xetaravel\Http\Controllers\Shop; |
|
3
|
|
|
|
|
4
|
|
|
use Xetaravel\Models\ShopItem; |
|
5
|
|
|
use Illuminate\Http\Request; |
|
6
|
|
|
|
|
7
|
|
|
class ItemController extends Controller |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* Constructor. |
|
11
|
|
|
*/ |
|
12
|
|
|
public function __construct() |
|
13
|
|
|
{ |
|
14
|
|
|
parent::__construct(); |
|
15
|
|
|
|
|
16
|
|
|
$this->breadcrumbs->removeListElementClasses('breadcrumb'); |
|
17
|
|
|
$this->breadcrumbs->addCrumb('Shop', route('shop.item.index')); |
|
18
|
|
|
} |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Show the list of all items. |
|
22
|
|
|
* |
|
23
|
|
|
* @return \Illuminate\Http\Response |
|
24
|
|
|
*/ |
|
25
|
|
|
public function index() |
|
26
|
|
|
{ |
|
27
|
|
|
$articles = ShopItem::with('category', 'user') |
|
28
|
|
|
->orderByDesc('created_at') |
|
29
|
|
|
->paginate(config('xetaravel.pagination.blog.article_per_page')); |
|
30
|
|
|
|
|
31
|
|
|
return view('Blog::article.index', ['articles' => $articles, 'breadcrumbs' => $this->breadcrumbs]); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* Show the article by his id. |
|
36
|
|
|
* |
|
37
|
|
|
* @return \Illuminate\Http\Response |
|
38
|
|
|
*/ |
|
39
|
|
|
public function show(Request $request, $slug, $id) |
|
40
|
|
|
{ |
|
41
|
|
|
$article = Article::with('category', 'user', 'comments') |
|
|
|
|
|
|
42
|
|
|
->where('id', $id) |
|
43
|
|
|
->first(); |
|
44
|
|
|
|
|
45
|
|
|
if (is_null($article)) { |
|
46
|
|
|
return redirect() |
|
47
|
|
|
->route('blog.article.index') |
|
48
|
|
|
->with('danger', 'This article doesn\'t exist or has been deleted !'); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
$comments = $article->comments()->paginate(config('xetaravel.pagination.blog.comment_per_page')); |
|
52
|
|
|
$comments->load('user'); |
|
53
|
|
|
|
|
54
|
|
|
$breadcrumbs = $this->breadcrumbs->addCrumb("Article : " . e($article->title), $article->article_url); |
|
55
|
|
|
|
|
56
|
|
|
return view('Blog::article.show', compact('article', 'comments', 'breadcrumbs')); |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths