|
1
|
|
|
<?php |
|
2
|
|
|
namespace App\Http\Controllers; |
|
3
|
|
|
|
|
4
|
|
|
use App\Repositories\ContactsRepository; |
|
5
|
|
|
use App\Http\Requests\ContactSend; |
|
6
|
|
|
use App\Repositories\LotRepository; |
|
7
|
|
|
use App\Repositories\ProductsRepository; |
|
8
|
|
|
use App\Repositories\PagesRepository; |
|
9
|
|
|
use App\Repositories\VendorRepository; |
|
10
|
|
|
use Illuminate\Http\Request; |
|
11
|
|
|
|
|
12
|
|
|
class PagesController extends Controller |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @var ContactsRepository |
|
16
|
|
|
*/ |
|
17
|
|
|
protected $contacts; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @var ProductsRepository |
|
21
|
|
|
*/ |
|
22
|
|
|
protected $products; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @var PagesRepository |
|
26
|
|
|
*/ |
|
27
|
|
|
protected $pages; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @var LotRepository |
|
31
|
|
|
*/ |
|
32
|
|
|
protected $lot; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* PagesController constructor. |
|
36
|
|
|
* @param ContactsRepository $contactsRepository |
|
37
|
|
|
* @param ProductsRepository $productsRepository |
|
38
|
|
|
*/ |
|
39
|
|
|
public function __construct( |
|
40
|
|
|
ContactsRepository $contactsRepository, |
|
41
|
|
|
ProductsRepository $productsRepository, |
|
42
|
|
|
PagesRepository $pagesRepository, |
|
43
|
|
|
LotRepository $lotRepository |
|
44
|
|
|
) { |
|
45
|
|
|
$this->contacts = $contactsRepository; |
|
46
|
|
|
$this->products = $productsRepository; |
|
47
|
|
|
$this->pages = $pagesRepository; |
|
48
|
|
|
$this->lot = $lotRepository; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Show page method. |
|
53
|
|
|
* |
|
54
|
|
|
* @param $page |
|
55
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
56
|
|
|
*/ |
|
57
|
|
|
public function show($page) |
|
58
|
|
|
{ |
|
59
|
|
|
return view('pages.show', ['item' => $page]); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
64
|
|
|
*/ |
|
65
|
|
|
public function help() |
|
66
|
|
|
{ |
|
67
|
|
|
$helpPages = $this->pages->getPagesHelp(); |
|
68
|
|
|
return view('pages.help', compact('helpPages')); |
|
69
|
|
|
} |
|
70
|
|
|
/** |
|
71
|
|
|
* Get contacts page. |
|
72
|
|
|
* |
|
73
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
74
|
|
|
*/ |
|
75
|
|
|
public function contacts() |
|
76
|
|
|
{ |
|
77
|
|
|
return view('home.contacts'); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @param ContactSend $request |
|
82
|
|
|
* @return mixed |
|
83
|
|
|
*/ |
|
84
|
|
|
public function send_contact(ContactSend $request) |
|
85
|
|
|
{ |
|
86
|
|
|
$this->contacts->sendContact($request->all()); |
|
87
|
|
|
|
|
88
|
|
|
return redirect()->back()->withStatus('Your message was send!'); |
|
|
|
|
|
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* Expire soon product page. |
|
93
|
|
|
* |
|
94
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
95
|
|
|
*/ |
|
96
|
|
|
public function expireSoonLots() |
|
97
|
|
|
{ |
|
98
|
|
|
$lot = $this->lot->getExpireSoon(10); |
|
99
|
|
|
|
|
100
|
|
|
return view('pages.expire_soon_products', compact('lot')); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* |
|
105
|
|
|
*/ |
|
106
|
|
|
public function lastAddedLots() |
|
107
|
|
|
{ |
|
108
|
|
|
$lot = $this->lot->getLatestLot(10); |
|
109
|
|
|
|
|
110
|
|
|
return view('pages.last_added_lots', compact('lot')); |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* Support static page. |
|
115
|
|
|
* |
|
116
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
117
|
|
|
*/ |
|
118
|
|
|
public function support() |
|
119
|
|
|
{ |
|
120
|
|
|
return view('pages.support'); |
|
121
|
|
|
} |
|
122
|
|
|
} |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.