Issues (32)

Http/Controllers/Admin/System/RoutesController.php (2 issues)

Labels
Severity
1
<?php namespace Arcanesoft\Foundation\Http\Controllers\Admin\System;
2
3
use Arcanedev\RouteViewer\Contracts\RouteViewer;
4
use Arcanesoft\Foundation\Policies\RouteViewerPolicy;
5
6
/**
7
 * Class     RoutesController
8
 *
9
 * @package  Arcanesoft\Foundation\Http\Controllers\System
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class RoutesController extends Controller
13
{
14
    /* -----------------------------------------------------------------
15
     |  Properties
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * The route viewer instance.
21
     *
22
     * @var \Arcanedev\RouteViewer\Contracts\RouteViewer
23
     */
24
    protected $routeViewer;
25
26
    /* -----------------------------------------------------------------
27
     |  Constructor
28
     | -----------------------------------------------------------------
29
     */
30
31
    /**
32
     * RoutesController constructor.
33
     *
34
     * @param  \Arcanedev\RouteViewer\Contracts\RouteViewer  $routeViewer
35
     */
36
    public function __construct(RouteViewer $routeViewer)
37
    {
38
        parent::__construct();
39
40
        $this->routeViewer = $routeViewer;
41
42
        $this->setCurrentPage('foundation-system-routes');
43
        $this->addBreadcrumbRoute(trans('foundation::route-viewer.titles.routes'), 'admin::foundation.system.routes.index');
0 ignored issues
show
The function trans was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
        $this->addBreadcrumbRoute(/** @scrutinizer ignore-call */ trans('foundation::route-viewer.titles.routes'), 'admin::foundation.system.routes.index');
Loading history...
44
    }
45
46
    /* -----------------------------------------------------------------
47
     |  Main Methods
48
     | -----------------------------------------------------------------
49
     */
50
51
    public function index()
52
    {
53
        $this->authorize(RouteViewerPolicy::PERMISSION_LIST);
54
55
        $this->setTitle($title = trans('foundation::route-viewer.titles.routes-list'));
0 ignored issues
show
The function trans was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

55
        $this->setTitle($title = /** @scrutinizer ignore-call */ trans('foundation::route-viewer.titles.routes-list'));
Loading history...
56
        $this->addBreadcrumb($title);
57
58
        return $this->view('admin.system.routes.list', [
59
            'routes' => $this->routeViewer->all()
60
        ]);
61
    }
62
}
63