Skip to content

Commit a3eb4b7

Browse files
committed
Update to Laravel 5.2
1 parent 02f6bf4 commit a3eb4b7

File tree

6 files changed

+100
-36
lines changed

6 files changed

+100
-36
lines changed

.env.example

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
APP_ENV=local
2+
APP_DEBUG=true
3+
APP_KEY=SomeRandomString
4+
5+
DB_HOST=localhost
6+
DB_DATABASE=homestead
7+
DB_USERNAME=homestead
8+
DB_PASSWORD=secret
9+
10+
CACHE_DRIVER=file
11+
SESSION_DRIVER=file
12+
QUEUE_DRIVER=sync
13+
14+
REDIS_HOST=localhost
15+
REDIS_PASSWORD=null
16+
REDIS_PORT=6379
17+
18+
MAIL_DRIVER=smtp
19+
MAIL_HOST=mailtrap.io
20+
MAIL_PORT=2525
21+
MAIL_USERNAME=null
22+
MAIL_PASSWORD=null
23+
MAIL_ENCRYPTION=null

app/Exceptions/Handler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Illuminate\Database\Eloquent\ModelNotFoundException;
1111
use Symfony\Component\HttpKernel\Exception\HttpException;
1212
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
13+
use Illuminate\Auth\Access\AuthorizationException;
14+
use Illuminate\Foundation\Validation\ValidationException;
15+
1316
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
1417

1518
class Handler extends ExceptionHandler
@@ -22,6 +25,8 @@ class Handler extends ExceptionHandler
2225
protected $dontReport = [
2326
HttpException::class,
2427
ModelNotFoundException::class,
28+
ValidationException::class,
29+
AuthorizationException::class,
2530
];
2631

2732
/**

app/Http/Controllers/Auth/AuthController.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ class AuthController extends Controller
3636
*/
3737
protected $redirectPath = '/';
3838

39-
/**
40-
* Failed post-authentication redirect location.
41-
*
42-
* @var string
43-
*/
44-
protected $loginPath = '/auth/login';
45-
4639
/**
4740
* Lockout time for failed login requests.
4841
*

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "project",
77
"require": {
88
"php": ">=5.5.9",
9-
"laravel/framework": "5.1.*",
9+
"laravel/framework": "5.2.*",
1010
"barryvdh/laravel-debugbar": "^2.0",
1111
"doctrine/dbal": "^2.5",
1212
"guzzlehttp/guzzle": "^6.1",
@@ -20,7 +20,9 @@
2020
"fzaninotto/faker": "~1.4",
2121
"mockery/mockery": "0.9.*",
2222
"phpunit/phpunit": "~4.0",
23-
"phpspec/phpspec": "~2.1"
23+
"phpspec/phpspec": "~2.1",
24+
"symfony/css-selector": "~3.0",
25+
"symfony/dom-crawler": "~3.0"
2426
},
2527
"autoload": {
2628
"classmap": [
@@ -40,8 +42,9 @@
4042
"php artisan clear-compiled",
4143
"php artisan optimize"
4244
],
43-
"pre-update-cmd": [
44-
"php artisan clear-compiled"
45+
"post-autoload-dump": [
46+
"php artisan clear-compiled",
47+
"php artisan optimize"
4548
],
4649
"post-update-cmd": [
4750
"php artisan optimize"

config/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
return [
44

5+
'env' => env('APP_ENV', 'production'),
6+
57
/*
68
|--------------------------------------------------------------------------
79
| Application Debug Mode
@@ -113,13 +115,11 @@
113115
/*
114116
* Laravel Framework Service Providers...
115117
*/
116-
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
117118
Illuminate\Auth\AuthServiceProvider::class,
118119
Illuminate\Broadcasting\BroadcastServiceProvider::class,
119120
Illuminate\Bus\BusServiceProvider::class,
120121
Illuminate\Cache\CacheServiceProvider::class,
121122
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
122-
Illuminate\Routing\ControllerServiceProvider::class,
123123
Illuminate\Cookie\CookieServiceProvider::class,
124124
Illuminate\Database\DatabaseServiceProvider::class,
125125
Illuminate\Encryption\EncryptionServiceProvider::class,

config/auth.php

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,104 @@
44

55
/*
66
|--------------------------------------------------------------------------
7-
| Default Authentication Driver
7+
| Authentication Defaults
88
|--------------------------------------------------------------------------
99
|
10-
| This option controls the authentication driver that will be utilized.
11-
| This driver manages the retrieval and authentication of the users
12-
| attempting to get access to protected areas of your application.
13-
|
14-
| Supported: "database", "eloquent"
10+
| This option controls the default authentication "guard" and password
11+
| reset options for your application. You may change these defaults
12+
| as required, but they're a perfect start for most applications.
1513
|
1614
*/
1715

18-
'driver' => 'eloquent',
16+
'defaults' => [
17+
'guard' => 'web',
18+
'passwords' => 'users',
19+
],
1920

2021
/*
2122
|--------------------------------------------------------------------------
22-
| Authentication Model
23+
| Authentication Guards
2324
|--------------------------------------------------------------------------
2425
|
25-
| When using the "Eloquent" authentication driver, we need to know which
26-
| Eloquent model should be used to retrieve your users. Of course, it
27-
| is often just the "User" model but you may use whatever you like.
26+
| Next, you may define every authentication guard for your application.
27+
| Of course, a great default configuration has been defined for you
28+
| here which uses session storage and the Eloquent user provider.
29+
|
30+
| All authentication drivers have a user provider. This defines how the
31+
| users are actually retrieved out of your database or other storage
32+
| mechanisms used by this application to persist your user's data.
33+
|
34+
| Supported: "session", "token"
2835
|
2936
*/
3037

31-
'model' => Pterodactyl\Models\User::class,
38+
'guards' => [
39+
'web' => [
40+
'driver' => 'session',
41+
'provider' => 'users',
42+
],
43+
44+
'api' => [
45+
'driver' => 'token',
46+
'provider' => 'users',
47+
],
48+
],
3249

3350
/*
3451
|--------------------------------------------------------------------------
35-
| Authentication Table
52+
| User Providers
3653
|--------------------------------------------------------------------------
3754
|
38-
| When using the "Database" authentication driver, we need to know which
39-
| table should be used to retrieve your users. We have chosen a basic
40-
| default value but you may easily change it to any table you like.
55+
| All authentication drivers have a user provider. This defines how the
56+
| users are actually retrieved out of your database or other storage
57+
| mechanisms used by this application to persist your user's data.
58+
|
59+
| If you have multiple user tables or models you may configure multiple
60+
| sources which represent each model / table. These sources may then
61+
| be assigned to any extra authentication guards you have defined.
62+
|
63+
| Supported: "database", "eloquent"
4164
|
4265
*/
4366

44-
'table' => 'users',
67+
'providers' => [
68+
'users' => [
69+
'driver' => 'eloquent',
70+
'model' => Pterodactyl\Models\User::class,
71+
],
72+
73+
// 'users' => [
74+
// 'driver' => 'database',
75+
// 'table' => 'users',
76+
// ],
77+
],
4578

4679
/*
4780
|--------------------------------------------------------------------------
48-
| Password Reset Settings
81+
| Resetting Passwords
4982
|--------------------------------------------------------------------------
5083
|
5184
| Here you may set the options for resetting passwords including the view
52-
| that is your password reset e-mail. You can also set the name of the
85+
| that is your password reset e-mail. You may also set the name of the
5386
| table that maintains all of the reset tokens for your application.
5487
|
88+
| You may specify multiple password reset configurations if you have more
89+
| than one user table or model in the application and you want to have
90+
| separate password reset settings based on the specific user types.
91+
|
5592
| The expire time is the number of minutes that the reset token should be
5693
| considered valid. This security feature keeps tokens short-lived so
5794
| they have less time to be guessed. You may change this as needed.
5895
|
5996
*/
6097

61-
'password' => [
62-
'email' => 'emails.password',
63-
'table' => 'password_resets',
64-
'expire' => 60,
98+
'passwords' => [
99+
'users' => [
100+
'provider' => 'users',
101+
'email' => 'emails.password',
102+
'table' => 'password_resets',
103+
'expire' => 60,
104+
],
65105
],
66106

67107
];

0 commit comments

Comments
 (0)