Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/5.7' into 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gabfr committed Nov 27, 2018
2 parents 1bf9d58 + b0013a2 commit f5e3d7f
Show file tree
Hide file tree
Showing 60 changed files with 646 additions and 138 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ matrix:
- php: 7.3
- php: 7.3
env: setup=lowest
allow_failures:
- php: 7.3

sudo: false

Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG-5.7.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Release Notes for 5.7.x

## [v5.7.15 (2018-11-26)](https://github.com/laravel/framework/compare/v5.7.14...v5.7.15)

### Added
- Added `date_equals` validation message ([#26584](https://github.com/laravel/framework/pull/26584))
- Added `starts_with` validation rule ([#26612](https://github.com/laravel/framework/pull/26612))
- Added relationship getters `BelongsToMany::getParentKeyName`, `BelongsToMany::getRelatedKeyName`, `HasManyThrough::getFirstKeyName`, `HasManyThrough::getForeignKeyName`, `HasManyThrough::getSecondLocalKeyName`, `HasOneOrMany::getLocalKeyName`, `MorphToMany::getInverse` ([#26607](https://github.com/laravel/framework/pull/26607))
- Make `ResourceCollection` countable ([#26595](https://github.com/laravel/framework/pull/26595))

### Fixed
- Fixed duplicate validation issue in `FormRequest::validated` method ([#26604](https://github.com/laravel/framework/pull/26604))
- <strong> Prevent breaking eager loading with string keys </strong> ([#26622](https://github.com/laravel/framework/pull/26622))


## [v5.7.14 (2018-11-21)](https://github.com/laravel/framework/compare/v5.7.13...v5.7.14)

### Added
- Added `Macroable` trait to `Illuminate\Cookie\CookieJar` ([#26445](https://github.com/laravel/framework/pull/26445))
- Added ability to disable password reset route ([#26459](https://github.com/laravel/framework/pull/26459))
- Added ability to publish error views ([#26460](https://github.com/laravel/framework/pull/26460))
- Added ability to set notifcation tries and timeout ([#26493](https://github.com/laravel/framework/pull/26493))
- Added `mail.log_channel` config for make `log` for mail driver configurable ([#26510](https://github.com/laravel/framework/pull/26510))
- Allowed `asset` root urls to be configurable via `app.asset_url` ([9172a67](https://github.com/laravel/framework/commit/9172a67b783952c1d3e15452d9c8646dc0b3eb6d))
- Added `Error while sending QUERY packet` string to `DetectsLostConnections` trait ([#26233](https://github.com/laravel/framework/pull/26560))
- Added env override for running in console ([a36906a](https://github.com/laravel/framework/commit/a36906ab8a141f1f497a0667196935e41970ae51), [19f2245](https://github.com/laravel/framework/commit/19f2245c6d7c87daf784f94b169f0dd4d98f0ca4))

### Fixed
- Fixed `UNION` aggregate queries with columns ([#26466](https://github.com/laravel/framework/pull/26466))
- Allowed migration table name to be guessed without `_table` suffix ([#26429](https://github.com/laravel/framework/pull/26429))
- Fixed `TestResponse::assertExactJson` for empty JSON objects ([#26353](https://github.com/laravel/framework/pull/26353), [e6ebc8d](https://github.com/laravel/framework/commit/e6ebc8d239e53e6daf16c869de3897ffbce6c751), [621d91d](https://github.com/laravel/framework/commit/621d91d802016ab4a64acc5c65f81cb9f5e5f779), [#26508](https://github.com/laravel/framework/pull/26508))
- Fixed cache repository for PHP from 7.2.12v ([#26495]( https://github.com/laravel/framework/pull/26495))
- Fixed user authorization check for Email Verification ([#26528](https://github.com/laravel/framework/pull/26528))
- Fixed nested JOINs on SQLite ([#26567](https://github.com/laravel/framework/pull/26567))

### Changed
- Improved eager loading performance ([#26434](https://github.com/laravel/framework/pull/26434), [#26453](https://github.com/laravel/framework/pull/26453), [3992140](https://github.com/laravel/framework/commit/3992140064307ef82d23328995e7c59045c231f2), [#26471](https://github.com/laravel/framework/pull/26471), [a3738cf](https://github.com/laravel/framework/commit/a3738cf4e133a4475c56b51f521a12db78e2ecbb), [#26531](https://github.com/laravel/framework/pull/26531))
- Adjusted `mix` missing asset exceptions ([#26431](https://github.com/laravel/framework/pull/26431))
- Used `asset` helper to generate full path urls in exception views ([#26411](https://github.com/laravel/framework/pull/26411))
- Changed `Illuminate\Foundation\Testing\Concerns\MocksApplicationServices::withoutJobs` method ([#26437](https://github.com/laravel/framework/pull/26437))
- Cached `distinct` validation rule data ([#26509](https://github.com/laravel/framework/pull/26509))
- Improved DNS Prefetching in view files ([#26552](https://github.com/laravel/framework/pull/26552))


## [v5.7.13 (2018-11-07)](https://github.com/laravel/framework/compare/v5.7.12...v5.7.13)

### Added
Expand Down
1 change: 0 additions & 1 deletion src/Illuminate/Auth/Access/Gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ protected function methodAllowsGuests($class, $method)
* Determine if the callback allows guests.
*
* @param callable $callback
* @param array $arguments
* @return bool
*/
protected function callbackAllowsGuests($callback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script src="{{ asset('js/app.js') }}" defer></script>

<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet" type="text/css">

<!-- Styles -->
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ protected function getMinutes($duration)
$duration = $this->parseDateInterval($duration);

if ($duration instanceof DateTimeInterface) {
$duration = Carbon::now()->diffInSeconds(Carbon::createFromTimestamp($duration->getTimestamp()), false) / 60;
$duration = Carbon::now()->diffInRealSeconds($duration, false) / 60;
}

return (int) ($duration * 60) > 0 ? $duration : null;
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ public function isAlias($name)
*/
public function bind($abstract, $concrete = null, $shared = false)
{
$this->dropStaleInstances($abstract);

// If no concrete type was given, we will simply set the concrete type to the
// abstract type. After that, the concrete type to be registered as shared
// without being forced to state their classes in both of the parameters.
$this->dropStaleInstances($abstract);

if (is_null($concrete)) {
$concrete = $abstract;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Contracts/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function put($path, $contents, $options = []);
*
* @param string $path
* @param resource $resource
* @param mixed $options
* @param array $options
* @return bool
*
* @throws \InvalidArgumentException If $resource is not a file handle.
Expand Down
14 changes: 7 additions & 7 deletions src/Illuminate/Contracts/Routing/Registrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Registrar
* Register a new GET route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function get($uri, $action);
Expand All @@ -17,7 +17,7 @@ public function get($uri, $action);
* Register a new POST route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function post($uri, $action);
Expand All @@ -26,7 +26,7 @@ public function post($uri, $action);
* Register a new PUT route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function put($uri, $action);
Expand All @@ -35,7 +35,7 @@ public function put($uri, $action);
* Register a new DELETE route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function delete($uri, $action);
Expand All @@ -44,7 +44,7 @@ public function delete($uri, $action);
* Register a new PATCH route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function patch($uri, $action);
Expand All @@ -53,7 +53,7 @@ public function patch($uri, $action);
* Register a new OPTIONS route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function options($uri, $action);
Expand All @@ -63,7 +63,7 @@ public function options($uri, $action);
*
* @param array|string $methods
* @param string $uri
* @param \Closure|array|string $action
* @param \Closure|array|string|callable $action
* @return \Illuminate\Routing\Route
*/
public function match($methods, $uri, $action);
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Database/DetectsLostConnections.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ protected function causedByLostConnection(Throwable $e)
'TCP Provider: Error code 0x68',
'Name or service not known',
'ORA-03114',
'Error while sending QUERY packet',
]);
}
}
3 changes: 0 additions & 3 deletions src/Illuminate/Database/Eloquent/Relations/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\Concerns\SupportsDefaultModels;

/**
* @mixin \Illuminate\Database\Eloquent\Builder
*/
class BelongsTo extends Relation
{
use SupportsDefaultModels;
Expand Down
20 changes: 20 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,16 @@ public function getQualifiedRelatedPivotKeyName()
return $this->table.'.'.$this->relatedPivotKey;
}

/**
* Get the parent key for the relationship.
*
* @return string
*/
public function getParentKeyName()
{
return $this->parentKey;
}

/**
* Get the fully qualified parent key name for the relation.
*
Expand All @@ -1031,6 +1041,16 @@ public function getQualifiedParentKeyName()
return $this->parent->qualifyColumn($this->parentKey);
}

/**
* Get the related key for the relationship.
*
* @return string
*/
public function getRelatedKeyName()
{
return $this->relatedKey;
}

/**
* Get the intermediate table for the relationship.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function getQueueableId()
/**
* Get a new query to restore one or more models by their queueable IDs.
*
* @param array|int $ids
* @param array<int> $ids
* @return \Illuminate\Database\Eloquent\Builder
*/
public function newQueryForRestoration($ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function toggle($ids, $touch = true)
/**
* Sync the intermediate tables with a list of IDs without detaching.
*
* @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array $ids
* @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array|Model $ids
* @return array
*/
public function syncWithoutDetaching($ids)
Expand All @@ -75,7 +75,7 @@ public function syncWithoutDetaching($ids)
/**
* Sync the intermediate tables with a list of IDs or collection of models.
*
* @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array $ids
* @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array|Model $ids
* @param bool $detaching
* @return array
*/
Expand Down
40 changes: 40 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,16 @@ public function getQualifiedFarKeyName()
return $this->getQualifiedForeignKeyName();
}

/**
* Get the foreign key on the "through" model.
*
* @return string
*/
public function getFirstKeyName()
{
return $this->firstKey;
}

/**
* Get the qualified foreign key on the "through" model.
*
Expand All @@ -546,6 +556,16 @@ public function getQualifiedFirstKeyName()
return $this->throughParent->qualifyColumn($this->firstKey);
}

/**
* Get the foreign key on the related model.
*
* @return string
*/
public function getForeignKeyName()
{
return $this->secondKey;
}

/**
* Get the qualified foreign key on the related model.
*
Expand All @@ -556,6 +576,16 @@ public function getQualifiedForeignKeyName()
return $this->related->qualifyColumn($this->secondKey);
}

/**
* Get the local key on the far parent model.
*
* @return string
*/
public function getLocalKeyName()
{
return $this->localKey;
}

/**
* Get the qualified local key on the far parent model.
*
Expand All @@ -565,4 +595,14 @@ public function getQualifiedLocalKeyName()
{
return $this->farParent->qualifyColumn($this->localKey);
}

/**
* Get the local key on the intermediary model.
*
* @return string
*/
public function getSecondLocalKeyName()
{
return $this->secondLocalKey;
}
}
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,14 @@ public function getQualifiedForeignKeyName()
{
return $this->foreignKey;
}

/**
* Get the local key for the relationship.
*
* @return string
*/
public function getLocalKeyName()
{
return $this->localKey;
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Relations/MorphPivot.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function newQueryForRestoration($ids)
/**
* Get a new query to restore multiple models by their queueable IDs.
*
* @param array|int $ids
* @param array<int> $ids
* @return \Illuminate\Database\Eloquent\Builder
*/
protected function newQueryForCollectionRestoration(array $ids)
Expand Down
3 changes: 0 additions & 3 deletions src/Illuminate/Database/Eloquent/Relations/MorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;

/**
* @mixin \Illuminate\Database\Eloquent\Builder
*/
class MorphTo extends BelongsTo
{
/**
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/MorphToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,14 @@ public function getMorphClass()
{
return $this->morphClass;
}

/**
* Get the indicator for a reverse relationship.
*
* @return bool
*/
public function getInverse()
{
return $this->inverse;
}
}
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ public function relatedUpdatedAt()
protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereInRaw'
&& $model->getIncrementing()
? 'whereIntegerInRaw'
: 'whereIn';
}

Expand Down
Loading

0 comments on commit f5e3d7f

Please sign in to comment.