@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * en = employee normal |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - protected $custom = ['mode'=>'en']; |
|
| 34 | + protected $custom = [ 'mode'=>'en' ]; |
|
| 35 | 35 | |
| 36 | - protected $username = ['email', 'company_id']; |
|
| 36 | + protected $username = [ 'email', 'company_id' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Create a new password controller instance. |
@@ -42,24 +42,24 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function __construct() |
| 44 | 44 | { |
| 45 | - config(['auth.model' => \plunner\Employee::class]); |
|
| 46 | - config(['jwt.user' => \plunner\Employee::class]); |
|
| 47 | - config(['auth.password.table' => 'password_resets_employees']); |
|
| 45 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
| 46 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
| 47 | + config([ 'auth.password.table' => 'password_resets_employees' ]); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function postEmail(Request $request) |
| 51 | 51 | { |
| 52 | - $this->validate($request, ['company' => 'required|exists:companies,name']); |
|
| 52 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]); |
|
| 53 | 53 | $this->company = Company::whereName($request->input('company'))->firstOrFail(); |
| 54 | - $request->merge(['company_id' => $this->company->id]); |
|
| 54 | + $request->merge([ 'company_id' => $this->company->id ]); |
|
| 55 | 55 | return $this->postEmailOriginal($request); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public function postReset(Request $request) |
| 59 | 59 | { |
| 60 | - $this->validate($request, ['company' => 'required|exists:companies,name']); |
|
| 60 | + $this->validate($request, [ 'company' => 'required|exists:companies,name' ]); |
|
| 61 | 61 | $this->company = Company::whereName($request->input('company'))->firstOrFail(); |
| 62 | - $request->merge(['company_id' => $this->company->id]); |
|
| 62 | + $request->merge([ 'company_id' => $this->company->id ]); |
|
| 63 | 63 | return $this->postResetOriginal($request); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -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 | |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * Companies |
| 20 | 20 | */ |
| 21 | -Route::group(['namespace' => 'Companies', 'prefix' => 'companies'], function() { |
|
| 21 | +Route::group([ 'namespace' => 'Companies', 'prefix' => 'companies' ], function() { |
|
| 22 | 22 | |
| 23 | 23 | //\Auth |
| 24 | 24 | |
| 25 | - Route::group(['namespace' => 'Auth'], function() { |
|
| 26 | - Route::group(['prefix' => 'auth'], function () { |
|
| 25 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
| 26 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
| 27 | 27 | // Authentication routes... |
| 28 | 28 | Route::post('login', 'AuthController@postLogin'); |
| 29 | 29 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - Route::group(['prefix' => 'password'], function () { |
|
| 35 | + Route::group([ 'prefix' => 'password' ], function() { |
|
| 36 | 36 | // Password reset link request routes... |
| 37 | 37 | Route::post('email', 'PasswordController@postEmail'); |
| 38 | 38 | |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | 44 | //example |
| 45 | - Route::resource('example', 'ExampleController', ['except' => ['create', 'edit']]); |
|
| 45 | + Route::resource('example', 'ExampleController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Employees |
| 51 | 51 | */ |
| 52 | -Route::group(['namespace' => 'Employees', 'prefix' => 'employees'], function() { |
|
| 52 | +Route::group([ 'namespace' => 'Employees', 'prefix' => 'employees' ], function() { |
|
| 53 | 53 | //\Auth |
| 54 | 54 | |
| 55 | - Route::group(['namespace' => 'Auth'], function() { |
|
| 56 | - Route::group(['prefix' => 'auth'], function () { |
|
| 55 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
| 56 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
| 57 | 57 | // Authentication routes... |
| 58 | 58 | Route::post('login', 'AuthController@postLogin'); |
| 59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | }); |
| 64 | 64 | |
| 65 | - Route::group(['prefix' => 'password'], function () { |
|
| 65 | + Route::group([ 'prefix' => 'password' ], function() { |
|
| 66 | 66 | // Password reset link request routes... |
| 67 | 67 | Route::post('email', 'PasswordController@postEmail'); |
| 68 | 68 | |
@@ -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 | } |
@@ -12,11 +12,11 @@ |
||
| 12 | 12 | | |
| 13 | 13 | */ |
| 14 | 14 | 'supportsCredentials' => false, |
| 15 | - 'allowedOrigins' => ['*'], |
|
| 16 | - 'allowedHeaders' => ['*'], |
|
| 17 | - 'allowedMethods' => ['GET', 'POST', 'PUT', 'DELETE'], |
|
| 18 | - 'exposedHeaders' => [], |
|
| 15 | + 'allowedOrigins' => [ '*' ], |
|
| 16 | + 'allowedHeaders' => [ '*' ], |
|
| 17 | + 'allowedMethods' => [ 'GET', 'POST', 'PUT', 'DELETE' ], |
|
| 18 | + 'exposedHeaders' => [ ], |
|
| 19 | 19 | 'maxAge' => 0, |
| 20 | - 'hosts' => [], |
|
| 20 | + 'hosts' => [ ], |
|
| 21 | 21 | ]; |
| 22 | 22 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | | |
| 90 | 90 | */ |
| 91 | 91 | |
| 92 | - 'required_claims' => ['iss', 'iat', 'exp', 'nbf', 'sub', 'jti'], |
|
| 92 | + 'required_claims' => [ 'iss', 'iat', 'exp', 'nbf', 'sub', 'jti' ], |
|
| 93 | 93 | |
| 94 | 94 | /* |
| 95 | 95 | |-------------------------------------------------------------------------- |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | | |
| 147 | 147 | */ |
| 148 | 148 | |
| 149 | - 'auth' => function ($app) { |
|
| 150 | - return new Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter($app['auth']); |
|
| 149 | + 'auth' => function($app) { |
|
| 150 | + return new Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter($app[ 'auth' ]); |
|
| 151 | 151 | }, |
| 152 | 152 | |
| 153 | 153 | /* |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | | |
| 160 | 160 | */ |
| 161 | 161 | |
| 162 | - 'storage' => function ($app) { |
|
| 163 | - return new Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter($app['cache']); |
|
| 162 | + 'storage' => function($app) { |
|
| 163 | + return new Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter($app[ 'cache' ]); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | ] |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | | |
| 55 | 55 | */ |
| 56 | 56 | |
| 57 | - 'from' => ['address' => '[email protected]', 'name' => 'plunner info'], |
|
| 57 | + 'from' => [ 'address' => '[email protected]', 'name' => 'plunner info' ], |
|
| 58 | 58 | |
| 59 | 59 | /* |
| 60 | 60 | |-------------------------------------------------------------------------- |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | | |
| 97 | 97 | */ |
| 98 | 98 | |
| 99 | - 'lottery' => [2, 100], |
|
| 99 | + 'lottery' => [ 2, 100 ], |
|
| 100 | 100 | |
| 101 | 101 | /* |
| 102 | 102 | |-------------------------------------------------------------------------- |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -$factory->define(plunner\Company::class, function (Faker\Generator $faker) { |
|
| 14 | +$factory->define(plunner\Company::class, function(Faker\Generator $faker) { |
|
| 15 | 15 | return [ |
| 16 | 16 | 'name' => $faker->name, |
| 17 | 17 | 'email' => $faker->email, |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | 23 | |
| 24 | -$factory->define(plunner\Employee::class, function (Faker\Generator $faker) { |
|
| 24 | +$factory->define(plunner\Employee::class, function(Faker\Generator $faker) { |
|
| 25 | 25 | return [ |
| 26 | 26 | 'name' => $faker->name, |
| 27 | 27 | 'email' => $faker->email, |