1 | <?php |
||
26 | class AdministrationController extends Controller |
||
27 | { |
||
28 | /** |
||
29 | * Show general application stats. |
||
30 | * |
||
31 | * @param Tag $tag |
||
32 | * @param Project $project |
||
33 | * @param User $user |
||
34 | * |
||
35 | * @return \Illuminate\View\View |
||
36 | */ |
||
37 | 2 | public function getIndex(Tag $tag, Project $project, User $user) |
|
38 | { |
||
39 | 2 | return view('administration.index', [ |
|
|
|||
40 | 2 | 'users' => $user->countUsers(), |
|
41 | 2 | 'active_projects' => $project->countOpenProjects(), |
|
42 | 2 | 'archived_projects' => $project->countArchivedProjects(), |
|
43 | 2 | 'open_issues' => $project->countOpenIssues(), |
|
44 | 2 | 'closed_issues' => $project->countClosedIssues(), |
|
45 | 2 | 'projects' => $this->auth->user()->projects()->get(), |
|
46 | 2 | 'tags' => $tag->count(), |
|
47 | 2 | ]); |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * Add new tag page. |
||
52 | * |
||
53 | * @param FormSettings $form |
||
54 | * |
||
55 | * @return \Illuminate\View\View |
||
56 | */ |
||
57 | 1 | public function getSettings(FormSettings $form) |
|
58 | { |
||
59 | 1 | return view('administration.settings', [ |
|
60 | 1 | 'form' => $form, |
|
61 | 1 | 'projects' => $this->auth->user()->projects()->get(), |
|
62 | 1 | ]); |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * To create new tag. |
||
67 | * |
||
68 | * @param FormRequest\Settings $request |
||
69 | * |
||
70 | * @return \Illuminate\Http\RedirectResponse |
||
71 | */ |
||
72 | 1 | public function postSettings(FormRequest\Settings $request) |
|
78 | |||
79 | /** |
||
80 | * Toggle site maintenance mode. |
||
81 | * |
||
82 | * @return \Illuminate\Http\RedirectResponse |
||
83 | */ |
||
84 | public function getChangeMaintenanceMode() |
||
96 | } |
||
97 |