Skip to content
This repository was archived by the owner on Mar 24, 2024. It is now read-only.

Commit ff33964

Browse files
committed
adapt latest Laravel changes
1 parent 5ef7dfb commit ff33964

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5510
-1413
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ MAIL_HOST=mailtrap.io
2727
MAIL_PORT=2525
2828
MAIL_USERNAME=null
2929
MAIL_PASSWORD=null
30+
MAIL_ENCRYPTION=null
3031

31-
ASSETS_PIPELINE=true
32+
ASSETS_PIPELINE=auto

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/vendor
22
/node_modules
3+
Homestead.yaml
4+
Homestead.json
35
.env
46

5-
## Composer
6-
composer.lock
7+
## PhpStorm
8+
.idea/
79

810
## Assets
911
/public/assets/min
10-
11-
## PhpStorm
12-
.idea/

app/Console/Commands/Inspire.php

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
<?php namespace SQLgreyGUI\Console\Commands;
1+
<?php
2+
3+
namespace SQLgreyGUI\Console\Commands;
24

35
use Illuminate\Console\Command;
46
use Illuminate\Foundation\Inspiring;
57

6-
class Inspire extends Command {
7-
8-
/**
9-
* The console command name.
10-
*
11-
* @var string
12-
*/
13-
protected $name = 'inspire';
14-
15-
/**
16-
* The console command description.
17-
*
18-
* @var string
19-
*/
20-
protected $description = 'Display an inspiring quote';
8+
class Inspire extends Command
9+
{
10+
/**
11+
* The name and signature of the console command.
12+
*
13+
* @var string
14+
*/
15+
protected $signature = 'inspire';
2116

22-
/**
23-
* Execute the console command.
24-
*
25-
* @return mixed
26-
*/
27-
public function handle()
28-
{
29-
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
30-
}
17+
/**
18+
* The console command description.
19+
*
20+
* @var string
21+
*/
22+
protected $description = 'Display an inspiring quote';
3123

24+
/**
25+
* Execute the console command.
26+
*
27+
* @return mixed
28+
*/
29+
public function handle()
30+
{
31+
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
32+
}
3233
}

app/Console/Kernel.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,22 @@
77

88
class Kernel extends ConsoleKernel
99
{
10-
1110
/**
1211
* The Artisan commands provided by your application.
1312
*
1413
* @var array
1514
*/
1615
protected $commands = [
17-
'SQLgreyGUI\Console\Commands\Inspire',
16+
//\SQLgreyGUI\Console\Commands\Inspire::class,
1817
];
1918

2019
/**
2120
* Define the application's command schedule.
2221
*
23-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
24-
* @return void
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2523
*/
2624
protected function schedule(Schedule $schedule)
2725
{
2826
//$schedule->command('inspire')->hourly();
2927
}
30-
3128
}

app/Events/Event.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<?php namespace SQLgreyGUI\Events;
1+
<?php
22

3-
abstract class Event {
4-
5-
//
3+
namespace SQLgreyGUI\Events;
64

5+
abstract class Event
6+
{
7+
//
78
}

app/Exceptions/Handler.php

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,51 @@
1-
<?php namespace SQLgreyGUI\Exceptions;
1+
<?php
2+
3+
namespace SQLgreyGUI\Exceptions;
24

35
use Exception;
6+
use Illuminate\Database\Eloquent\ModelNotFoundException;
7+
use Symfony\Component\HttpKernel\Exception\HttpException;
8+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
49
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
510

6-
class Handler extends ExceptionHandler {
7-
8-
/**
9-
* A list of the exception types that should not be reported.
10-
*
11-
* @var array
12-
*/
13-
protected $dontReport = [
14-
'Symfony\Component\HttpKernel\Exception\HttpException'
15-
];
11+
class Handler extends ExceptionHandler
12+
{
13+
/**
14+
* A list of the exception types that should not be reported.
15+
*
16+
* @var array
17+
*/
18+
protected $dontReport = [
19+
HttpException::class,
20+
ModelNotFoundException::class,
21+
];
1622

17-
/**
18-
* Report or log an exception.
19-
*
20-
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
21-
*
22-
* @param \Exception $e
23-
* @return void
24-
*/
25-
public function report(Exception $e)
26-
{
27-
return parent::report($e);
28-
}
23+
/**
24+
* Report or log an exception.
25+
*
26+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
27+
*
28+
* @param \Exception $e
29+
*/
30+
public function report(Exception $e)
31+
{
32+
return parent::report($e);
33+
}
2934

30-
/**
31-
* Render an exception into an HTTP response.
32-
*
33-
* @param \Illuminate\Http\Request $request
34-
* @param \Exception $e
35-
* @return \Illuminate\Http\Response
36-
*/
37-
public function render($request, Exception $e)
38-
{
39-
return parent::render($request, $e);
40-
}
35+
/**
36+
* Render an exception into an HTTP response.
37+
*
38+
* @param \Illuminate\Http\Request $request
39+
* @param \Exception $e
40+
*
41+
* @return \Illuminate\Http\Response
42+
*/
43+
public function render($request, Exception $e)
44+
{
45+
if ($e instanceof ModelNotFoundException) {
46+
$e = new NotFoundHttpException($e->getMessage(), $e);
47+
}
4148

49+
return parent::render($request, $e);
50+
}
4251
}

app/Http/Controllers/Controller.php

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,37 @@
22

33
namespace SQLgreyGUI\Http\Controllers;
44

5-
use Illuminate\Foundation\Bus\DispatchesCommands;
5+
use Illuminate\Foundation\Bus\DispatchesJobs;
66
use Illuminate\Routing\Controller as BaseController;
77
use Illuminate\Foundation\Validation\ValidatesRequests;
8+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
9+
use Auth;
810

911
abstract class Controller extends BaseController
1012
{
11-
12-
use DispatchesCommands,
13-
ValidatesRequests;
13+
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
1414

1515
/**
16-
* the user id
17-
*
16+
* the user id.
17+
*
1818
* @var int
1919
*/
2020
protected $userid;
2121

2222
/**
23-
* User
24-
*
23+
* User.
24+
*
2525
* @var \SQLgreyGUI\Models\User
2626
*/
2727
protected $user;
2828

2929
/**
30-
* Constructor
31-
*
32-
* @return void
30+
* Constructor.
3331
*/
3432
public function __construct()
3533
{
36-
if (\Auth::viaRemember()) {
37-
\Auth::login(\Auth::User());
38-
}
39-
40-
if (\Auth::check()) {
41-
$this->user = \Auth::User();
34+
if (Auth::check()) {
35+
$this->user = Auth::User();
4236

4337
$this->userid = $this->user->getId();
4438

@@ -48,8 +42,8 @@ public function __construct()
4842
}
4943

5044
/**
51-
* parse provided entries
52-
*
45+
* parse provided entries.
46+
*
5347
* @return array
5448
*/
5549
protected function parseEntries($input_identifier, $repository)
@@ -70,8 +64,8 @@ protected function parseEntries($input_identifier, $repository)
7064
}
7165

7266
/**
73-
* get name of the current controller
74-
*
67+
* get name of the current controller.
68+
*
7569
* @return string
7670
*/
7771
protected function getController()
@@ -82,25 +76,24 @@ protected function getController()
8276
}
8377

8478
/**
85-
* get action
86-
*
79+
* get action.
80+
*
8781
* @param string $action
88-
*
82+
*
8983
* @return string
9084
*/
9185
public function getAction($action)
9286
{
93-
return $this->getController() . '@' . $action;
87+
return $this->getController().'@'.$action;
9488
}
9589

9690
/**
97-
* is ajax request
98-
*
99-
* @return boolean
91+
* is ajax request.
92+
*
93+
* @return bool
10094
*/
10195
protected function isAjax()
10296
{
10397
return \Request::ajax();
10498
}
105-
10699
}

app/Http/Kernel.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@
66

77
class Kernel extends HttpKernel
88
{
9-
109
/**
1110
* The application's global HTTP middleware stack.
1211
*
1312
* @var array
1413
*/
1514
protected $middleware = [
16-
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
17-
'Illuminate\Cookie\Middleware\EncryptCookies',
18-
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
19-
'Illuminate\Session\Middleware\StartSession',
20-
'Illuminate\View\Middleware\ShareErrorsFromSession',
21-
'SQLgreyGUI\Http\Middleware\VerifyCsrfToken',
15+
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
16+
\SQLgreyGUI\Http\Middleware\EncryptCookies::class,
17+
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
18+
\Illuminate\Session\Middleware\StartSession::class,
19+
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
20+
\SQLgreyGUI\Http\Middleware\VerifyCsrfToken::class,
2221
];
2322

2423
/**
@@ -27,9 +26,8 @@ class Kernel extends HttpKernel
2726
* @var array
2827
*/
2928
protected $routeMiddleware = [
30-
'auth' => 'SQLgreyGUI\Http\Middleware\Authenticate',
31-
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
32-
'guest' => 'SQLgreyGUI\Http\Middleware\RedirectIfAuthenticated',
29+
'auth' => \SQLgreyGUI\Http\Middleware\Authenticate::class,
30+
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
31+
'guest' => \SQLgreyGUI\Http\Middleware\RedirectIfAuthenticated::class,
3332
];
34-
3533
}

app/Http/Middleware/Authenticate.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class Authenticate
99
{
10-
1110
/**
1211
* The Guard implementation.
1312
*
@@ -18,8 +17,7 @@ class Authenticate
1817
/**
1918
* Create a new filter instance.
2019
*
21-
* @param Guard $auth
22-
* @return void
20+
* @param Guard $auth
2321
*/
2422
public function __construct(Guard $auth)
2523
{
@@ -29,8 +27,9 @@ public function __construct(Guard $auth)
2927
/**
3028
* Handle an incoming request.
3129
*
32-
* @param \Illuminate\Http\Request $request
33-
* @param \Closure $next
30+
* @param \Illuminate\Http\Request $request
31+
* @param \Closure $next
32+
*
3433
* @return mixed
3534
*/
3635
public function handle($request, Closure $next)
@@ -45,5 +44,4 @@ public function handle($request, Closure $next)
4544

4645
return $next($request);
4746
}
48-
4947
}

0 commit comments

Comments
 (0)