1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of Gitamin. |
5
|
|
|
* |
6
|
|
|
* Copyright (C) 2015-2016 The Gitamin Team |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Gitamin\Http\Controllers\Dashboard; |
13
|
|
|
|
14
|
|
|
use Gitamin\Models\Issue; |
15
|
|
|
use Illuminate\Foundation\Bus\DispatchesJobs; |
16
|
|
|
use Illuminate\Routing\Controller; |
17
|
|
|
use Illuminate\Support\Facades\View; |
18
|
|
|
|
19
|
|
|
class IssueController extends Controller |
20
|
|
|
{ |
21
|
|
|
use DispatchesJobs; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Stores the sub-sidebar tree list. |
25
|
|
|
* |
26
|
|
|
* @var array |
27
|
|
|
*/ |
28
|
|
|
protected $subMenu = []; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Creates a new issue controller instance. |
32
|
|
|
* |
33
|
|
|
* @return \Gitamin\Http\Controllers\IssueController |
|
|
|
|
34
|
|
|
*/ |
35
|
|
|
public function __construct() |
36
|
|
|
{ |
37
|
|
|
$this->subMenu = [ |
38
|
|
|
'issues' => [ |
39
|
|
|
'title' => trans('dashboard.issues.all'), |
40
|
|
|
'url' => route('dashboard.issues.index'), |
41
|
|
|
'icon' => 'fa fa-exclamation-circle', |
42
|
|
|
'active' => true, |
43
|
|
|
], |
44
|
|
|
]; |
45
|
|
|
|
46
|
|
|
View::share('sub_menu', $this->subMenu); |
47
|
|
|
View::share('sub_title', trans('dashboard.issues.title')); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Shows the issues view. |
52
|
|
|
* |
53
|
|
|
* @return \Illuminate\View\View |
54
|
|
|
*/ |
55
|
|
|
public function indexAction() |
56
|
|
|
{ |
57
|
|
|
$issues = Issue::orderBy('created_at', 'desc')->get(); |
58
|
|
|
|
59
|
|
|
return View::make('dashboard.issues.index') |
60
|
|
|
->withPageTitle(trans('dashboard.issues.issues').' - '.trans('dashboard.dashboard')) |
61
|
|
|
->withIssues($issues); |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.