Skip to content

Commit 912716b

Browse files
authored
Merge pull request #4515 from browner12/patch-1
[5.8] update upgrade guide
2 parents 3e3f824 + ef60ef0 commit 912716b

File tree

1 file changed

+10
-263
lines changed

1 file changed

+10
-263
lines changed

upgrade.md

Lines changed: 10 additions & 263 deletions
Original file line numberDiff line numberDiff line change
@@ -1,281 +1,28 @@
11
# Upgrade Guide
22

3-
- [Upgrading To 5.7.0 From 5.6](#upgrade-5.7.0)
3+
- [Upgrading To 5.8.0 From 5.7](#upgrade-5.8.0)
44

5-
<a name="upgrade-5.7.0"></a>
6-
## Upgrading To 5.7.0 From 5.6
5+
<a name="upgrade-5.8.0"></a>
6+
## Upgrading To 5.8.0 From 5.7
77

8-
#### Estimated Upgrade Time: 10 - 15 Minutes
8+
#### Estimated Upgrade Time: TBD
99

1010
> {note} We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.
1111
1212
### Updating Dependencies
1313

14-
Update your `laravel/framework` dependency to `5.7.*` in your `composer.json` file.
14+
Update your `laravel/framework` dependency to `5.8.*` in your `composer.json` file.
1515

16-
Of course, don't forget to examine any 3rd party packages consumed by your application and verify you are using the proper version for Laravel 5.7 support.
17-
18-
### Application
19-
20-
#### The `register` Method
21-
22-
**Likelihood Of Impact: Very Low**
23-
24-
The unused `options` argument of the `Illuminate\Foundation\Application` class' `register` method has been removed. If you are overriding this method, you should update your method's signature:
25-
26-
/**
27-
* Register a service provider with the application.
28-
*
29-
* @param \Illuminate\Support\ServiceProvider|string $provider
30-
* @param bool $force
31-
* @return \Illuminate\Support\ServiceProvider
32-
*/
33-
public function register($provider, $force = false);
34-
35-
### Authentication
36-
37-
#### The `Authenticate` Middleware
38-
39-
**Likelihood Of Impact: Low**
40-
41-
The `authenticate` method of the `Illuminate\Auth\Middleware\Authenticate` middleware has been updated to accept the incoming `$request` as its first argument. If you are overriding this method in your own `Authenticate` middleware, you should update your middleware's signature:
42-
43-
/**
44-
* Determine if the user is logged in to any of the given guards.
45-
*
46-
* @param \Illuminate\Http\Request $request
47-
* @param array $guards
48-
* @return void
49-
*
50-
* @throws \Illuminate\Auth\AuthenticationException
51-
*/
52-
protected function authenticate($request, array $guards)
53-
54-
#### The `ResetsPasswords` Trait
55-
56-
**Likelihood Of Impact: Low**
57-
58-
The protected `sendResetResponse` method of the `ResetsPasswords` trait now accepts the incoming `Illuminate\Http\Request` as its first argument. If you are overriding this method, you should update your method's signature:
59-
60-
/**
61-
* Get the response for a successful password reset.
62-
*
63-
* @param \Illuminate\Http\Request $request
64-
* @param string $response
65-
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
66-
*/
67-
protected function sendResetResponse(Request $request, $response)
68-
69-
#### The `SendsPasswordResetEmails` Trait
70-
71-
**Likelihood Of Impact: Low**
72-
73-
The protected `sendResetLinkResponse` method of the `SendsPasswordResetEmails` trait now accepts the incoming `Illuminate\Http\Request` as its first argument. If you are overriding this method, you should update your method's signature:
74-
75-
/**
76-
* Get the response for a successful password reset link.
77-
*
78-
* @param \Illuminate\Http\Request $request
79-
* @param string $response
80-
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
81-
*/
82-
protected function sendResetLinkResponse(Request $request, $response)
83-
84-
### Authorization
85-
86-
#### The `Gate` Contract
87-
88-
**Likelihood Of Impact: Very Low**
89-
90-
The `raw` was changed from `protected` to `public` visibility. In addition, it [was added to the `Illuminate/Contracts/Auth/Access/Gate` contract](https://github.com/laravel/framework/pull/25143):
91-
92-
/**
93-
* Get the raw result from the authorization callback.
94-
*
95-
* @param string $ability
96-
* @param array|mixed $arguments
97-
* @return mixed
98-
*/
99-
public function raw($ability, $arguments = []);
100-
101-
If you are implementing this interface, you should add this method to your implementation.
102-
103-
### Blade
104-
105-
#### The `or` Operator
106-
107-
**Likelihood Of Impact: High**
108-
109-
The Blade "or" operator has been removed in favor of PHP's built-in `??` "null coalesce" operator, which has the same purpose and functionality:
110-
111-
// Laravel 5.6...
112-
{{ $foo or 'default' }}
113-
114-
// Laravel 5.7...
115-
{{ $foo ?? 'default' }}
116-
117-
### Carbon
118-
119-
**Likelihood Of Impact: Very Low**
120-
121-
Carbon "macros" are now handled by the Carbon library directly instead of Laravel's extension of the library. We do not expect this to break your code; however, [please make us aware of any problems you encounter related to this change](https://github.com/laravel/framework/pull/23938).
122-
123-
### Collections
124-
125-
#### The `split` Method
126-
127-
**Likelihood Of Impact: Low**
128-
129-
The `split` method [has been updated to always return the requested number of "groups"](https://github.com/laravel/framework/pull/24088), unless the total number of items in the original collection is less than the requested collection count. Generally, this should be considered a bug fix; however, it is listed as a breaking change out of caution.
130-
131-
### Cookie
132-
133-
#### `Factory` Contract Method Signature
134-
135-
**Likelihood Of Impact: Very Low**
136-
137-
The signatures of the `make` and `forever` methods of the `Illuminate/Contracts/Cookie/Factory` interface [have been changed](https://github.com/laravel/framework/pull/23200). If you are implementing this interface, you should update these methods in your implementation.
138-
139-
### Database
140-
141-
#### The `softDeletesTz` Migration Method
142-
143-
**Likelihood Of Impact: Low**
144-
145-
The schema table builder's `softDeletesTz` method now accepts the column name as its first argument, while the `$precision` has been moved to the second argument position:
146-
147-
/**
148-
* Add a "deleted at" timestampTz for the table.
149-
*
150-
* @param string $column
151-
* @param int $precision
152-
* @return \Illuminate\Support\Fluent
153-
*/
154-
public function softDeletesTz($column = 'deleted_at', $precision = 0)
155-
156-
#### The `ConnectionInterface` Contract
157-
158-
**Likelihood Of Impact: Very Low**
159-
160-
The `Illuminate\Contracts\Database\ConnectionInterface` contract's `select` and `selectOne` method signatures have been updated to accommodate the new `$useReadPdo` argument:
161-
162-
/**
163-
* Run a select statement and return a single result.
164-
*
165-
* @param string $query
166-
* @param array $bindings
167-
* @param bool $useReadPdo
168-
* @return mixed
169-
*/
170-
public function selectOne($query, $bindings = [], $useReadPdo = true);
171-
172-
/**
173-
* Run a select statement against the database.
174-
*
175-
* @param string $query
176-
* @param array $bindings
177-
* @param bool $useReadPdo
178-
* @return array
179-
*/
180-
public function select($query, $bindings = [], $useReadPdo = true);
181-
182-
In addition, the `cursor` method was added to the contract:
183-
184-
/**
185-
* Run a select statement against the database and returns a generator.
186-
*
187-
* @param string $query
188-
* @param array $bindings
189-
* @param bool $useReadPdo
190-
* @return \Generator
191-
*/
192-
public function cursor($query, $bindings = [], $useReadPdo = true);
193-
194-
If you are implementing this interface, you should add this method to your implementation.
195-
196-
#### SQL Server Driver Priority
197-
198-
**Likelihood Of Impact: Low**
199-
200-
Prior to Laravel 5.7, the `PDO_DBLIB` driver was used as the default SQL Server PDO driver. This driver is considered deprecated by Microsoft. As of Laravel 5.7, `PDO_SQLSRV` will be used as the default driver if it is available. Alternatively, you may choose to use the `PDO_ODBC` driver:
201-
202-
'sqlsrv' => [
203-
// ...
204-
'odbc' => true,
205-
'odbc_datasource_name' => 'your-odbc-dsn',
206-
],
207-
208-
If neither of these drivers are available, Laravel will use the `PDO_DBLIB` driver.
209-
210-
### Debug
211-
212-
#### Dumper Classes
213-
214-
**Likelihood Of Impact: Very Low**
215-
216-
The `Illuminate\Support\Debug\Dumper` and `Illuminate\Support\Debug\HtmlDumper` classes have been removed in favor of using Symfony's native variable dumpers: `Symfony\Component\VarDumper\VarDumper` and `Symfony\Component\VarDumper\Dumper\HtmlDumper`.
217-
218-
### Eloquent
219-
220-
#### The `latest` / `oldest` Methods
221-
222-
**Likelihood Of Impact: Low**
223-
224-
The Eloquent query builder's `latest` and `oldest` methods have been updated to respect custom "created at" timestamp columns that may be specified on your Eloquent models. Generally, this should be considered a bug fix; however, it is listed as a breaking change out of caution.
225-
226-
#### The `wasChanged` Method
227-
228-
**Likelihood Of Impact: Very Low**
229-
230-
An Eloquent model's changes are now available to the `wasChanged` method **before** firing the `updated` model event. Generally, this should be considered a bug fix; however, it is listed as a breaking change out of caution. [Please let us know if you encounter any issues surrounding this change](https://github.com/laravel/framework/pull/25026).
231-
232-
### Email Verification
233-
234-
**Likelihood Of Impact: Optional**
235-
236-
If you choose to use Laravel's new [email verification services](/docs/{{version}}/verification), you will need to add additional scaffolding to your application. First, add the `VerificationController` to your application: [App\Http\Controllers\Auth\VerificationController](https://github.com/laravel/laravel/blob/develop/app/Http/Controllers/Auth/VerificationController.php).
237-
238-
You will also need the verification view stub. This view should be placed at `resources/views/auth/verify.blade.php`. You may obtain the view's contents [on GitHub](https://github.com/laravel/framework/blob/5.7/src/Illuminate/Auth/Console/stubs/make/views/auth/verify.stub).
239-
240-
Finally, when calling the `Auth::routes` method, you should pass the `verify` option to the method:
241-
242-
Auth::routes(['verify' => true]);
243-
244-
### Filesystem
245-
246-
#### `Filesystem` Contract Methods
247-
248-
**Likelihood Of Impact: Low**
249-
250-
The `readStream` and `writeStream` methods [have been added to the `Illuminate\Contracts\Filesystem\Filesystem` contract](https://github.com/laravel/framework/pull/23755). If you are implementing this interface, you should add these methods to your implementation.
251-
252-
### Mail
253-
254-
#### Mailable Dynamic Variable Casing
255-
256-
**Likelihood Of Impact: Medium**
257-
258-
Variables that are dynamically passed to mailable views [are now automatically "camel cased"](https://github.com/laravel/framework/pull/24232), which makes mailable dynamic variable behavior consistent with dynamic view variables. Dynamic mailable variables are not a documented Laravel feature, so likelihood of impact to your application is low.
16+
Of course, don't forget to examine any 3rd party packages consumed by your application and verify you are using the proper version for Laravel 5.8 support.
25917

26018
### Routing
26119

262-
#### The `Route::redirect` Method
263-
264-
The `Route::redirect` method now returns a `302` HTTP status code redirect. The `permanentRedirect` method has been added to allow `301` redirects.
265-
266-
// Return a 302 redirect...
267-
Route::redirect('/foo', '/bar');
20+
#### The `UrlGenerator` Contract
26821

269-
// Return a 301 redirect...
270-
Route::redirect('/foo', '/bar', 301);
271-
272-
// Return a 301 redirect...
273-
Route::permanentRedirect('/foo', '/bar');
274-
275-
#### The `addRoute` Method
22+
**Likelihood Of Impact: Very Low**
27623

277-
The `addRoute` method of the `Illuminate\Routing\Router` class has been changed from `protected` to `public`.
24+
The `previous` method [has been added to the `Illuminate\Contracts\Routing\UrlGenerator` contract](https://github.com/laravel/framework/pull/25616). If you are implementing this interface, you should add this method to your implementation.
27825

27926
### Miscellaneous
28027

281-
We also encourage you to view the changes in the `laravel/laravel` [GitHub repository](https://github.com/laravel/laravel). While many of these changes are not required, you may wish to keep these files in sync with your application. Some of these changes will be covered in this upgrade guide, but others, such as changes to configuration files or comments, will not be. You can easily view the changes with the [GitHub comparison tool](https://github.com/laravel/laravel/compare/5.6...master) and choose which updates are important to you.
28+
We also encourage you to view the changes in the `laravel/laravel` [GitHub repository](https://github.com/laravel/laravel). While many of these changes are not required, you may wish to keep these files in sync with your application. Some of these changes will be covered in this upgrade guide, but others, such as changes to configuration files or comments, will not be. You can easily view the changes with the [GitHub comparison tool](https://github.com/laravel/laravel/compare/5.7...master) and choose which updates are important to you.

0 commit comments

Comments
 (0)