/
ReportController.php
40 lines (34 loc) · 986 Bytes
/
ReportController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace App\Controllers;
use App\Controllers\Base\UserBaseController;
use App\Repositories\ReportRepository;
/**
*
*@author : Tiamiyu waliu
*@website : http://www.iDocrea8.com
*/
class ReportController extends UserBaseController
{
public function __construct(ReportRepository $reportRepository)
{
$this->reportRepository = $reportRepository;
parent::__construct();
}
public function index()
{
$url = \Input::get('url');
$type = \Request::segment(2);
$message = null;
if ($val = \Input::get('val'))
{
if ($this->reportRepository->add($val)) {
return \Redirect::route('user-home');
} else {
$message = trans('report.error');
}
}
return $this->render('report.form', ['url' => $url, 'type' => $type, 'message' => $message], [
'title' => $this->setTitle(trans('report.report-content'))
]);
}
}