@@ -25,6 +25,6 @@  | 
                                                    ||
| 25 | 25 | protected function schedule(Schedule $schedule)  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | 27 |          $schedule->command('inspire') | 
                                                        
| 28 | - ->hourly();  | 
                                                        |
| 28 | + ->hourly();  | 
                                                        |
| 29 | 29 | }  | 
                                                        
| 30 | 30 | }  | 
                                                        
@@ -29,7 +29,7 @@ discard block  | 
                                                    ||
| 29 | 29 | * cn = company normal  | 
                                                        
| 30 | 30 | * @var array  | 
                                                        
| 31 | 31 | */  | 
                                                        
| 32 | - protected $custom = ['mode'=>'cn'];  | 
                                                        |
| 32 | + protected $custom = [ 'mode'=>'cn' ];  | 
                                                        |
| 33 | 33 | |
| 34 | 34 | /**  | 
                                                        
| 35 | 35 | * Create a new authentication controller instance.  | 
                                                        
@@ -38,8 +38,8 @@ discard block  | 
                                                    ||
| 38 | 38 | */  | 
                                                        
| 39 | 39 | public function __construct()  | 
                                                        
| 40 | 40 |      { | 
                                                        
| 41 | - config(['auth.model' => \plunner\Company::class]);  | 
                                                        |
| 42 | - config(['jwt.user' => \plunner\Company::class]);  | 
                                                        |
| 41 | + config([ 'auth.model' => \plunner\Company::class ]);  | 
                                                        |
| 42 | + config([ 'jwt.user' => \plunner\Company::class ]);  | 
                                                        |
| 43 | 43 | }  | 
                                                        
| 44 | 44 | |
| 45 | 45 | /**  | 
                                                        
@@ -66,9 +66,9 @@ discard block  | 
                                                    ||
| 66 | 66 | protected function create(array $data)  | 
                                                        
| 67 | 67 |      { | 
                                                        
| 68 | 68 | return Company::create([  | 
                                                        
| 69 | - 'name' => $data['name'],  | 
                                                        |
| 70 | - 'email' => $data['email'],  | 
                                                        |
| 71 | - 'password' => bcrypt($data['password']),  | 
                                                        |
| 69 | + 'name' => $data[ 'name' ],  | 
                                                        |
| 70 | + 'email' => $data[ 'email' ],  | 
                                                        |
| 71 | + 'password' => bcrypt($data[ 'password' ]),  | 
                                                        |
| 72 | 72 | ]);  | 
                                                        
| 73 | 73 | }  | 
                                                        
| 74 | 74 | }  | 
                                                        
@@ -2,11 +2,11 @@  | 
                                                    ||
| 2 | 2 | |
| 3 | 3 | namespace plunner\Http\Controllers\Companies\Auth;  | 
                                                        
| 4 | 4 | |
| 5 | -use plunner\Company;  | 
                                                        |
| 6 | -use Validator;  | 
                                                        |
| 7 | -use plunner\Http\Controllers\Controller;  | 
                                                        |
| 8 | 5 | use Tymon\JWTAuth\Support\auth\AuthenticatesAndRegistersUsers;  | 
                                                        
| 9 | 6 | use Tymon\JWTAuth\Support\auth\ThrottlesLogins;  | 
                                                        
| 7 | +use Validator;  | 
                                                        |
| 8 | +use plunner\Company;  | 
                                                        |
| 9 | +use plunner\Http\Controllers\Controller;  | 
                                                        |
| 10 | 10 | |
| 11 | 11 | class AuthController extends Controller  | 
                                                        
| 12 | 12 |  { | 
                                                        
@@ -20,8 +20,8 @@  | 
                                                    ||
| 20 | 20 | */  | 
                                                        
| 21 | 21 | public function __construct()  | 
                                                        
| 22 | 22 |      { | 
                                                        
| 23 | - config(['auth.model' => \plunner\Company::class]);  | 
                                                        |
| 24 | - config(['jwt.user' => \plunner\Company::class]);  | 
                                                        |
| 23 | + config([ 'auth.model' => \plunner\Company::class ]);  | 
                                                        |
| 24 | + config([ 'jwt.user' => \plunner\Company::class ]);  | 
                                                        |
| 25 | 25 |          $this->middleware('jwt.authandrefresh:mode-cn'); | 
                                                        
| 26 | 26 | }  | 
                                                        
| 27 | 27 | |
@@ -4,9 +4,8 @@  | 
                                                    ||
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request;  | 
                                                        
| 6 | 6 | |
| 7 | -use plunner\Http\Requests;  | 
                                                        |
| 8 | -use plunner\Http\Controllers\Controller;  | 
                                                        |
| 9 | 7 | use Tymon\JWTAuth\Facades\JWTAuth;  | 
                                                        
| 8 | +use plunner\Http\Controllers\Controller;  | 
                                                        |
| 10 | 9 | |
| 11 | 10 | class ExampleController extends Controller  | 
                                                        
| 12 | 11 |  { | 
                                                        
@@ -36,7 +36,7 @@ discard block  | 
                                                    ||
| 36 | 36 | * en = employee normal  | 
                                                        
| 37 | 37 | * @var array  | 
                                                        
| 38 | 38 | */  | 
                                                        
| 39 | - protected $custom = ['mode'=>'en'];  | 
                                                        |
| 39 | + protected $custom = [ 'mode'=>'en' ];  | 
                                                        |
| 40 | 40 | |
| 41 | 41 | /**  | 
                                                        
| 42 | 42 | * @var company  | 
                                                        
@@ -50,8 +50,8 @@ discard block  | 
                                                    ||
| 50 | 50 | */  | 
                                                        
| 51 | 51 | public function __construct()  | 
                                                        
| 52 | 52 |      { | 
                                                        
| 53 | - config(['auth.model' => \plunner\Employee::class]);  | 
                                                        |
| 54 | - config(['jwt.user' => \plunner\Employee::class]);  | 
                                                        |
| 53 | + config([ 'auth.model' => \plunner\Employee::class ]);  | 
                                                        |
| 54 | + config([ 'jwt.user' => \plunner\Employee::class ]);  | 
                                                        |
| 55 | 55 | }  | 
                                                        
| 56 | 56 | |
| 57 | 57 | /**  | 
                                                        
@@ -78,15 +78,15 @@ discard block  | 
                                                    ||
| 78 | 78 | protected function create(array $data)  | 
                                                        
| 79 | 79 |      { | 
                                                        
| 80 | 80 | return $this->company->save(new employee([  | 
                                                        
| 81 | - 'name' => $data['name'],  | 
                                                        |
| 82 | - 'email' => $data['email'],  | 
                                                        |
| 83 | - 'password' => bcrypt($data['password']),  | 
                                                        |
| 81 | + 'name' => $data[ 'name' ],  | 
                                                        |
| 82 | + 'email' => $data[ 'email' ],  | 
                                                        |
| 83 | + 'password' => bcrypt($data[ 'password' ]),  | 
                                                        |
| 84 | 84 | ]));  | 
                                                        
| 85 | 85 | }  | 
                                                        
| 86 | 86 | |
| 87 | 87 | public function postRegister(Request $request)  | 
                                                        
| 88 | 88 |      { | 
                                                        
| 89 | - $this->validate($request, ['company' => 'required|exists:companies,name']);  | 
                                                        |
| 89 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]);  | 
                                                        |
| 90 | 90 |          $this->company = Company::whereName($request->input('company'))->firstOrFail(); | 
                                                        
| 91 | 91 | return $this->postRegisterOriginal($request);  | 
                                                        
| 92 | 92 | }  | 
                                                        
@@ -94,9 +94,9 @@ discard block  | 
                                                    ||
| 94 | 94 | |
| 95 | 95 | public function postLogin(Request $request)  | 
                                                        
| 96 | 96 |      { | 
                                                        
| 97 | - $this->validate($request, ['company' => 'required|exists:companies,name']);  | 
                                                        |
| 97 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]);  | 
                                                        |
| 98 | 98 |          $this->company = Company::whereName($request->input('company'))->firstOrFail(); | 
                                                        
| 99 | - $request->merge(['company_id' => $this->company->id]);  | 
                                                        |
| 99 | + $request->merge([ 'company_id' => $this->company->id ]);  | 
                                                        |
| 100 | 100 | return $this->postLoginOriginal($request);  | 
                                                        
| 101 | 101 | }  | 
                                                        
| 102 | 102 | |
@@ -3,13 +3,12 @@  | 
                                                    ||
| 3 | 3 | namespace plunner\Http\Controllers\Employees\Auth;  | 
                                                        
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request;  | 
                                                        
| 6 | -use plunner\Company;  | 
                                                        |
| 7 | -use plunner\employee;  | 
                                                        |
| 8 | -use Validator;  | 
                                                        |
| 9 | -use plunner\Http\Controllers\Controller;  | 
                                                        |
| 10 | 6 | use Tymon\JWTAuth\Support\auth\AuthenticatesAndRegistersUsers;  | 
                                                        
| 11 | 7 | use Tymon\JWTAuth\Support\auth\ThrottlesLogins;  | 
                                                        
| 12 | -use Log;  | 
                                                        |
| 8 | +use Validator;  | 
                                                        |
| 9 | +use plunner\Company;  | 
                                                        |
| 10 | +use plunner\Http\Controllers\Controller;  | 
                                                        |
| 11 | +use plunner\employee;  | 
                                                        |
| 13 | 12 | |
| 14 | 13 | class AuthController extends Controller  | 
                                                        
| 15 | 14 |  { | 
                                                        
@@ -22,16 +22,16 @@  | 
                                                    ||
| 22 | 22 |      { | 
                                                        
| 23 | 23 | |
| 24 | 24 | // Don't validate CSRF when testing.  | 
                                                        
| 25 | -        if(env('APP_ENV') === 'testing') { | 
                                                        |
| 25 | +        if (env('APP_ENV') === 'testing') { | 
                                                        |
| 26 | 26 | return true;  | 
                                                        
| 27 | 27 | }  | 
                                                        
| 28 | 28 | |
| 29 | -        Log::info('Request: '.implode(',',$request->all())); | 
                                                        |
| 29 | +        Log::info('Request: '.implode(',', $request->all())); | 
                                                        |
| 30 | 30 | |
| 31 | 31 |          $token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN'); | 
                                                        
| 32 | 32 | |
| 33 | 33 |          Log::info('Sent token 1: '.$token); | 
                                                        
| 34 | -        if (! $token && $header = $request->header('X-XSRF-TOKEN')) { | 
                                                        |
| 34 | +        if (!$token && $header = $request->header('X-XSRF-TOKEN')) { | 
                                                        |
| 35 | 35 | $token = $this->encrypter->decrypt($header);  | 
                                                        
| 36 | 36 | }  | 
                                                        
| 37 | 37 | |
@@ -37,7 +37,7 @@  | 
                                                    ||
| 37 | 37 | */  | 
                                                        
| 38 | 38 | public function map(Router $router)  | 
                                                        
| 39 | 39 |      { | 
                                                        
| 40 | -        $router->group(['namespace' => $this->namespace], function ($router) { | 
                                                        |
| 40 | +        $router->group([ 'namespace' => $this->namespace ], function($router) { | 
                                                        |
| 41 | 41 |              require app_path('Http/routes.php'); | 
                                                        
| 42 | 42 | });  | 
                                                        
| 43 | 43 | }  | 
                                                        
@@ -51,14 +51,14 @@  | 
                                                    ||
| 51 | 51 | *  | 
                                                        
| 52 | 52 | * @var array  | 
                                                        
| 53 | 53 | */  | 
                                                        
| 54 | - protected $fillable = ['name', 'email', 'password'];  | 
                                                        |
| 54 | + protected $fillable = [ 'name', 'email', 'password' ];  | 
                                                        |
| 55 | 55 | |
| 56 | 56 | /**  | 
                                                        
| 57 | 57 | * The attributes excluded from the model's JSON form.  | 
                                                        
| 58 | 58 | *  | 
                                                        
| 59 | 59 | * @var array  | 
                                                        
| 60 | 60 | */  | 
                                                        
| 61 | - protected $hidden = ['password', 'remember_token'];  | 
                                                        |
| 61 | + protected $hidden = [ 'password', 'remember_token' ];  | 
                                                        |
| 62 | 62 | |
| 63 | 63 | public function company()  | 
                                                        
| 64 | 64 |      { | 
                                                        
@@ -3,8 +3,8 @@  | 
                                                    ||
| 3 | 3 | namespace plunner\Http\Controllers\Employees\Auth;  | 
                                                        
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request;  | 
                                                        
| 6 | -use plunner\Http\Controllers\Controller;  | 
                                                        |
| 7 | 6 | use Tymon\JWTAuth\Support\auth\ResetsPasswords;  | 
                                                        
| 7 | +use plunner\Http\Controllers\Controller;  | 
                                                        |
| 8 | 8 | use \plunner\Company;  | 
                                                        
| 9 | 9 | use \plunner\Employee;  | 
                                                        
| 10 | 10 | |
@@ -38,12 +38,12 @@ discard block  | 
                                                    ||
| 38 | 38 | * en = employee normal  | 
                                                        
| 39 | 39 | * @var array  | 
                                                        
| 40 | 40 | */  | 
                                                        
| 41 | - protected $custom = ['mode'=>'en'];  | 
                                                        |
| 41 | + protected $custom = [ 'mode'=>'en' ];  | 
                                                        |
| 42 | 42 | |
| 43 | 43 | /**  | 
                                                        
| 44 | 44 | * @var array  | 
                                                        
| 45 | 45 | */  | 
                                                        
| 46 | - protected $username = ['email', 'company_id'];  | 
                                                        |
| 46 | + protected $username = [ 'email', 'company_id' ];  | 
                                                        |
| 47 | 47 | |
| 48 | 48 | /**  | 
                                                        
| 49 | 49 | * @var company  | 
                                                        
@@ -57,24 +57,24 @@ discard block  | 
                                                    ||
| 57 | 57 | */  | 
                                                        
| 58 | 58 | public function __construct()  | 
                                                        
| 59 | 59 |      { | 
                                                        
| 60 | - config(['auth.model' => \plunner\Employee::class]);  | 
                                                        |
| 61 | - config(['jwt.user' => \plunner\Employee::class]);  | 
                                                        |
| 62 | - config(['auth.password.table' => 'password_resets_employees', 'auth.password.email' => 'emails.employees.password']);  | 
                                                        |
| 60 | + config([ 'auth.model' => \plunner\Employee::class ]);  | 
                                                        |
| 61 | + config([ 'jwt.user' => \plunner\Employee::class ]);  | 
                                                        |
| 62 | + config([ 'auth.password.table' => 'password_resets_employees', 'auth.password.email' => 'emails.employees.password' ]);  | 
                                                        |
| 63 | 63 | }  | 
                                                        
| 64 | 64 | |
| 65 | 65 | public function postEmail(Request $request)  | 
                                                        
| 66 | 66 |      { | 
                                                        
| 67 | - $this->validate($request, ['company' => 'required|exists:companies,name']);  | 
                                                        |
| 67 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]);  | 
                                                        |
| 68 | 68 |          $this->company = Company::whereName($request->input('company'))->firstOrFail(); | 
                                                        
| 69 | - $request->merge(['company_id' => $this->company->id]);  | 
                                                        |
| 69 | + $request->merge([ 'company_id' => $this->company->id ]);  | 
                                                        |
| 70 | 70 | return $this->postEmailOriginal($request);  | 
                                                        
| 71 | 71 | }  | 
                                                        
| 72 | 72 | |
| 73 | 73 | public function postReset(Request $request)  | 
                                                        
| 74 | 74 |      { | 
                                                        
| 75 | - $this->validate($request, ['company' => 'required|exists:companies,name']);  | 
                                                        |
| 75 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]);  | 
                                                        |
| 76 | 76 |          $this->company = Company::whereName($request->input('company'))->firstOrFail(); | 
                                                        
| 77 | - $request->merge(['company_id' => $this->company->id]);  | 
                                                        |
| 77 | + $request->merge([ 'company_id' => $this->company->id ]);  | 
                                                        |
| 78 | 78 | return $this->postResetOriginal($request);  | 
                                                        
| 79 | 79 | }  | 
                                                        
| 80 | 80 | |
@@ -20,8 +20,8 @@  | 
                                                    ||
| 20 | 20 | */  | 
                                                        
| 21 | 21 | public function __construct()  | 
                                                        
| 22 | 22 |      { | 
                                                        
| 23 | - config(['auth.model' => \plunner\Company::class]);  | 
                                                        |
| 24 | - config(['jwt.user' => \plunner\Company::class]);  | 
                                                        |
| 23 | + config([ 'auth.model' => \plunner\Company::class ]);  | 
                                                        |
| 24 | + config([ 'jwt.user' => \plunner\Company::class ]);  | 
                                                        |
| 25 | 25 |          $this->middleware('jwt.authandrefresh:mode-cn'); | 
                                                        
| 26 | 26 | }  | 
                                                        
| 27 | 27 | |