@@ -8,6 +8,6 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function index() |
| 10 | 10 | { |
| 11 | - return response()->json(['ok']); |
|
| 11 | + return response()->json([ 'ok' ]); |
|
| 12 | 12 | } |
| 13 | 13 | } |
@@ -20,6 +20,6 @@ |
||
| 20 | 20 | 'password' => Hash::make('letmein') |
| 21 | 21 | ]); |
| 22 | 22 | } |
| 23 | - User::create(['name' => 'ando', 'email' => '[email protected]', 'password' => Hash::make('letmein')]); |
|
| 23 | + User::create([ 'name' => 'ando', 'email' => '[email protected]', 'password' => Hash::make('letmein') ]); |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | \ No newline at end of file |
@@ -10,16 +10,16 @@ discard block |
||
| 10 | 10 | | and give it the controller to call when that URI is requested. |
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | -Route::group(['namespace' => 'V1', 'prefix' => 'v1', 'middleware' => 'api'], function () { |
|
| 13 | +Route::group([ 'namespace' => 'V1', 'prefix' => 'v1', 'middleware' => 'api' ], function() { |
|
| 14 | 14 | // Route::get('puppy', 'PuppyController@index'); |
| 15 | 15 | }); |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -Route::group(['middleware' => \App\Http\Middleware\SpeakJson::class], function () { |
|
| 18 | +Route::group([ 'middleware' => \App\Http\Middleware\SpeakJson::class ], function() { |
|
| 19 | 19 | Route::post('v1/token', 'V1\TokenController@store'); |
| 20 | 20 | |
| 21 | - Route::get('/', function () { |
|
| 22 | - return ['name' => 'improv.ee api', 'documentation' => 'https://github.com/improv-ee/api']; |
|
| 21 | + Route::get('/', function() { |
|
| 22 | + return [ 'name' => 'improv.ee api', 'documentation' => 'https://github.com/improv-ee/api' ]; |
|
| 23 | 23 | }); |
| 24 | 24 | }); |
| 25 | 25 | |
@@ -35,6 +35,6 @@ discard block |
||
| 35 | 35 | | |
| 36 | 36 | */ |
| 37 | 37 | |
| 38 | -Route::group(['middleware' => ['web']], function () { |
|
| 38 | +Route::group([ 'middleware' => [ 'web' ] ], function() { |
|
| 39 | 39 | // |
| 40 | 40 | }); |
@@ -31,13 +31,13 @@ |
||
| 31 | 31 | $this->getThrottleKey($request) |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - abort(Response::HTTP_TOO_MANY_REQUESTS,$this->getLockoutErrorMessage($seconds)); |
|
| 34 | + abort(Response::HTTP_TOO_MANY_REQUESTS, $this->getLockoutErrorMessage($seconds)); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | // Attempt to verify the credentials and create a token for the user |
| 38 | 38 | if (!$token = JWTAuth::attempt($credentials)) { |
| 39 | 39 | $this->incrementLoginAttempts($request); |
| 40 | - abort(Response::HTTP_UNAUTHORIZED,Lang::get('auth.failed')); |
|
| 40 | + abort(Response::HTTP_UNAUTHORIZED, Lang::get('auth.failed')); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return response($encoder->encodeData(new Token($token)), Response::HTTP_CREATED); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | $accept = $request->header('accept', '*/*'); |
| 30 | 30 | |
| 31 | - if (!in_array($accept, ['*/*', MediaTypeInterface::JSON_API_MEDIA_TYPE])) { |
|
| 31 | + if (!in_array($accept, [ '*/*', MediaTypeInterface::JSON_API_MEDIA_TYPE ])) { |
|
| 32 | 32 | return response(null, Response::HTTP_NOT_ACCEPTABLE); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | if ($e instanceof HttpException) { |
| 55 | 55 | |
| 56 | - $message = $e->getMessage() ?: Response::$statusTexts[$e->getStatusCode()]; |
|
| 56 | + $message = $e->getMessage() ?: Response::$statusTexts[ $e->getStatusCode() ]; |
|
| 57 | 57 | |
| 58 | 58 | $error = new Error(null, null, $e->getStatusCode(), null, $message); |
| 59 | 59 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $encoder = App::make(EncoderInterface::class); |
| 62 | 62 | |
| 63 | 63 | return response($encoder->encodeError($error), $e->getStatusCode(), |
| 64 | - ['Content-Type' => MediaTypeInterface::JSON_API_MEDIA_TYPE]); |
|
| 64 | + [ 'Content-Type' => MediaTypeInterface::JSON_API_MEDIA_TYPE ]); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return parent::render($request, $e); |