Completed
Pull Request — master (#11)
by claudio
06:28 queued 03:11
created

EmployeesController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace plunner\Http\Controllers\Employees;
4
5
use plunner\Http\Controllers\Controller;
6
use plunner\Http\Requests;
7
use plunner\Employee;
8
9
class EmployeesController extends Controller
10
{
11
    /**
12
     * @var plunner/Employee
13
     */
14
    private $user;
0 ignored issues
show
Unused Code introduced by
The property $user is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
15
16
    /**
17
     * ExampleController constructor.
18
     */
19 4
    public function __construct()
20
    {
21 4
        config(['auth.model' => \plunner\Employee::class]);
22 4
        config(['jwt.user' => \plunner\Employee::class]);
23 4
        $this->middleware('jwt.authandrefresh:mode-en');
24 4
    }
25
26
    /**
27
     * Display a listing of the resource.
28
     *
29
     * @return \Illuminate\Http\Response
30
     */
31 2
    public function index()
32
    {
33 2
        $employee = \Auth::user();
34 2
        $company = $employee->company;
35 2
        return $company->employees;
36
    }
37
}
38