Skip to content

Commit afb5011

Browse files
committed
Update to Laravel 5.3
[BREAKING] — REMOVES REMOTE API A new API will need to be implemented properly using the new Laravel Passport OAuth2 system. DingoAPI was becoming too unstable and development wasn’t really moving along enough to continue to rely on it.
1 parent b274b40 commit afb5011

37 files changed

+732
-1596
lines changed

app/Exceptions/Handler.php

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
use DisplayValidationException;
88
use AccountNotFoundException;
99

10-
use Illuminate\Database\Eloquent\ModelNotFoundException;
11-
use Symfony\Component\HttpKernel\Exception\HttpException;
12-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
13-
use Illuminate\Auth\Access\AuthorizationException;
14-
use Illuminate\Foundation\Validation\ValidationException;
15-
10+
use Illuminate\Auth\AuthenticationException;
1611
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
1712

1813
class Handler extends ExceptionHandler
@@ -23,10 +18,12 @@ class Handler extends ExceptionHandler
2318
* @var array
2419
*/
2520
protected $dontReport = [
26-
HttpException::class,
27-
ModelNotFoundException::class,
28-
ValidationException::class,
29-
AuthorizationException::class,
21+
\Illuminate\Auth\AuthenticationException::class,
22+
\Illuminate\Auth\Access\AuthorizationException::class,
23+
\Symfony\Component\HttpKernel\Exception\HttpException::class,
24+
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
25+
\Illuminate\Session\TokenMismatchException::class,
26+
\Illuminate\Validation\ValidationException::class,
3027
];
3128

3229
/**
@@ -37,9 +34,9 @@ class Handler extends ExceptionHandler
3734
* @param \Exception $e
3835
* @return void
3936
*/
40-
public function report(Exception $e)
37+
public function report(Exception $exception)
4138
{
42-
return parent::report($e);
39+
return parent::report($exception);
4340
}
4441

4542
/**
@@ -83,4 +80,20 @@ public function render($request, Exception $e)
8380

8481
return parent::render($request, $e);
8582
}
83+
84+
/**
85+
* Convert an authentication exception into an unauthenticated response.
86+
*
87+
* @param \Illuminate\Http\Request $request
88+
* @param \Illuminate\Auth\AuthenticationException $exception
89+
* @return \Illuminate\Http\Response
90+
*/
91+
protected function unauthenticated($request, AuthenticationException $exception)
92+
{
93+
if ($request->expectsJson()) {
94+
return response()->json(['error' => 'Unauthenticated.'], 401);
95+
}
96+
return redirect()->guest('/auth/login');
97+
}
98+
8699
}

app/Http/Controllers/API/BaseController.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/Http/Controllers/API/LocationController.php

Lines changed: 0 additions & 64 deletions
This file was deleted.

app/Http/Controllers/API/NodeController.php

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)