@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * cn = company normal |
41 | 41 | * @var array |
42 | 42 | */ |
43 | - protected $custom = ['mode' => 'cn']; |
|
43 | + protected $custom = [ 'mode' => 'cn' ]; |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Create a new authentication controller instance. |
@@ -48,22 +48,22 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function __construct() |
50 | 50 | { |
51 | - config(['auth.model' => \plunner\Company::class]); |
|
52 | - config(['jwt.user' => \plunner\Company::class]); |
|
51 | + config([ 'auth.model' => \plunner\Company::class ]); |
|
52 | + config([ 'jwt.user' => \plunner\Company::class ]); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function postLogin(Request $request) |
56 | 56 | { |
57 | 57 | //remember me |
58 | - $this->validate($request, ['remember' => 'required|boolean']); |
|
59 | - $this->validate($request, ['token' => 'sometimes|required|max:255']); |
|
58 | + $this->validate($request, [ 'remember' => 'required|boolean' ]); |
|
59 | + $this->validate($request, [ 'token' => 'sometimes|required|max:255' ]); |
|
60 | 60 | if ($request->input('remember', false)) { |
61 | - config(['jwt.ttl' => '43200']); //30 days |
|
62 | - $this->custom = array_merge($this->custom, ['remember' => 'true']); |
|
61 | + config([ 'jwt.ttl' => '43200' ]); //30 days |
|
62 | + $this->custom = array_merge($this->custom, [ 'remember' => 'true' ]); |
|
63 | 63 | } else |
64 | - $this->custom = array_merge($this->custom, ['remember' => 'false']); |
|
64 | + $this->custom = array_merge($this->custom, [ 'remember' => 'false' ]); |
|
65 | 65 | $ret = $this->postLoginOriginal($request); |
66 | - if($ret->getStatusCode() == 200) |
|
66 | + if ($ret->getStatusCode() == 200) |
|
67 | 67 | ;//TODO store the token |
68 | 68 | return $ret; |
69 | 69 | } |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | protected function create(array $data) |
94 | 94 | { |
95 | 95 | return Company::create([ |
96 | - 'name' => $data['name'], |
|
97 | - 'email' => $data['email'], |
|
98 | - 'password' => bcrypt($data['password']), |
|
96 | + 'name' => $data[ 'name' ], |
|
97 | + 'email' => $data[ 'email' ], |
|
98 | + 'password' => bcrypt($data[ 'password' ]), |
|
99 | 99 | ]); |
100 | 100 | } |
101 | 101 |