Skip to content

Commit

Permalink
Upgrade to Laravel 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
leonjza committed Oct 15, 2016
1 parent 2940be7 commit 148a6b9
Show file tree
Hide file tree
Showing 63 changed files with 822 additions and 608 deletions.
18 changes: 14 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_KEY=SomeRandomString
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=seat
DB_USERNAME=seat
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=redis
SESSION_DRIVER=file
QUEUE_DRIVER=redis

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=[email protected]

EVE_CLIENT_ID=null
EVE_CLIENT_SECRET=null
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* text=auto
*.css linguist-vendored
*.less linguist-vendored
*.scss linguist-vendored
24 changes: 15 additions & 9 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

namespace App\Console;

use DB;
use Exception;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Schema;
use Seat\Services\Models\Schedule as DBSchedule;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Seat\Services\Models\Schedule as DbSchedule;

/**
* Class Kernel
* @package App\Console
*/
class Kernel extends ConsoleKernel
{

Expand Down Expand Up @@ -53,7 +48,7 @@ protected function schedule(Schedule $schedule)
}

// Load the schedule from the database
foreach (DBSchedule::all() as $job) {
foreach (DbSchedule::all() as $job) {

$command = $schedule->command($job['command'])
->cron($job['expression']);
Expand All @@ -74,4 +69,15 @@ protected function schedule(Schedule $schedule)

}
}

/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{

require base_path('routes/console.php');
}
}
8 changes: 0 additions & 8 deletions app/Events/Event.php

This file was deleted.

40 changes: 27 additions & 13 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace App\Exceptions;

use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
Expand All @@ -16,36 +14,52 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
HttpException::class,
ModelNotFoundException::class,
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Exception $exception
* @return void
*/
public function report(Exception $e)
public function report(Exception $exception)
{
return parent::report($e);
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Exception $exception)
{
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return parent::render($request, $e);
return redirect()->guest('login');
}
}
65 changes: 0 additions & 65 deletions app/Http/Controllers/Auth/AuthController.php

This file was deleted.

32 changes: 0 additions & 32 deletions app/Http/Controllers/Auth/PasswordController.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

abstract class Controller extends BaseController
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
35 changes: 29 additions & 6 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,48 @@ class Kernel extends HttpKernel
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
];

/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],

'api' => [
'throttle:60,1',
'bindings',
],
];

/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}
47 changes: 0 additions & 47 deletions app/Http/Middleware/Authenticate.php

This file was deleted.

Loading

0 comments on commit 148a6b9

Please sign in to comment.