Skip to content

Commit

Permalink
Merge pull request #16 from laravel/5.7
Browse files Browse the repository at this point in the history
dffth
  • Loading branch information
imanghafoori1 authored Feb 2, 2019
2 parents 1079984 + 0682ecb commit 8a2aa77
Show file tree
Hide file tree
Showing 51 changed files with 590 additions and 82 deletions.
39 changes: 38 additions & 1 deletion CHANGELOG-5.7.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
# Release Notes for 5.7.x

## [Unreleased](https://github.com/laravel/framework/compare/v5.7.21...5.7)
## [Unreleased](https://github.com/laravel/framework/compare/v5.7.24...5.7)


## [v5.7.24 (2019-01-30)](https://github.com/laravel/framework/compare/v5.7.23...v5.7.24)

### Fixed
- Fixed `ResetPassword` notification ([#27351](https://github.com/laravel/framework/pull/27351), [b130771](https://github.com/laravel/framework/commit/b13077164bc6b4cb032b9eec7f5209402b5260eb))


## [v5.7.23 (2019-01-29)](https://github.com/laravel/framework/compare/v5.7.22...v5.7.23)

### Added
- Added `AbstractPaginator::getOptions()` method ([#27273](https://github.com/laravel/framework/pull/27273))
- Added `Communication link failure` to `DetectsLostConnections` trait ([#27307](https://github.com/laravel/framework/pull/27307))
- Added `orWhere()` `proxy` for `scopes` to `EloquentBuilder` ([#27281](https://github.com/laravel/framework/pull/27281), [2e6fe85](https://github.com/laravel/framework/commit/2e6fe855c7d7d9d3cbf34e1fbea17c8059640c5c))
- Allow the `app path` to be configured ([#27332](https://github.com/laravel/framework/pull/27332), [d73e672](https://github.com/laravel/framework/commit/d73e6729cefb26c2fbcb16e47daefc2ba86b9697))
- Added config for using `WhatFailureGroupHandler` when `StackDriver` created for Logger ([#27308](https://github.com/laravel/framework/pull/27308) ,[6a92651](https://github.com/laravel/framework/commit/6a926519e8e3905013569e7b3fcdd598ec7cece3))

### Fixed
- Fixed `QueueableCollection` serialization of Eloquent Models when using `Binary IDs` ([#27271](https://github.com/laravel/framework/pull/27271))
- Replaced `newModelQuery()` with `newQueryWithoutRelationships()` for `UPDATE`/`DELETE` queries ([#27277](https://github.com/laravel/framework/pull/27277))

### Changed
- Apply parameters to entire localization array ([#27254](https://github.com/laravel/framework/pull/27254))
- Added line about expiring password reset in notification email ([#27324](https://github.com/laravel/framework/pull/27324), [80c5aec](https://github.com/laravel/framework/commit/80c5aecb443e7a55e868b66b9e0a93b7dfec08e8))
- "Go Home" link will redirect to the `home` route on exception page ([#27343](https://github.com/laravel/framework/pull/27343))


## [v5.7.22 (2019-01-22)](https://github.com/laravel/framework/compare/v5.7.21...v5.7.22)

### Fixed
- Fixed `TestResponse::assertJsonValidationErrors()` when there are no errors ([#27190](https://github.com/laravel/framework/pull/27190))

### Changed
- Allowed `TestResponse::assertJsonMissingValidationErrors()` to be called without an argument ([#27176](https://github.com/laravel/framework/pull/27176))
- Updated vue preset's vue-stubs for laravel-mix 4 compatibility ([#27229](https://github.com/laravel/framework/pull/27229))
- Updated preset to use `@babel/preset-react` ([#27235](https://github.com/laravel/framework/pull/27235))
- Used `config` to resolve the database value during tests. ([#27240](https://github.com/laravel/framework/pull/27240))


## [v5.7.21 (2019-01-15)](https://github.com/laravel/framework/compare/v5.7.20...v5.7.21)
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Auth/Notifications/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function toMail($notifiable)
->subject(Lang::getFromJson('Reset Password Notification'))
->line(Lang::getFromJson('You are receiving this email because we received a password reset request for your account.'))
->action(Lang::getFromJson('Reset Password'), url(config('app.url').route('password.reset', $this->token, false)))
->line(Lang::getFromJson('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.users.expire')]))
->line(Lang::getFromJson('If you did not request a password reset, no further action is required.'));
}

Expand Down
20 changes: 10 additions & 10 deletions src/Illuminate/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct($app)
}

/**
* Get a cache store instance by name.
* Get a cache store instance by name, wrapped in a repository.
*
* @param string|null $name
* @return \Illuminate\Contracts\Cache\Repository
Expand Down Expand Up @@ -124,7 +124,7 @@ protected function callCustomCreator(array $config)
* Create an instance of the APC cache driver.
*
* @param array $config
* @return \Illuminate\Cache\ApcStore
* @return \Illuminate\Cache\Repository
*/
protected function createApcDriver(array $config)
{
Expand All @@ -136,7 +136,7 @@ protected function createApcDriver(array $config)
/**
* Create an instance of the array cache driver.
*
* @return \Illuminate\Cache\ArrayStore
* @return \Illuminate\Cache\Repository
*/
protected function createArrayDriver()
{
Expand All @@ -147,7 +147,7 @@ protected function createArrayDriver()
* Create an instance of the file cache driver.
*
* @param array $config
* @return \Illuminate\Cache\FileStore
* @return \Illuminate\Cache\Repository
*/
protected function createFileDriver(array $config)
{
Expand All @@ -158,7 +158,7 @@ protected function createFileDriver(array $config)
* Create an instance of the Memcached cache driver.
*
* @param array $config
* @return \Illuminate\Cache\MemcachedStore
* @return \Illuminate\Cache\Repository
*/
protected function createMemcachedDriver(array $config)
{
Expand All @@ -177,7 +177,7 @@ protected function createMemcachedDriver(array $config)
/**
* Create an instance of the Null cache driver.
*
* @return \Illuminate\Cache\NullStore
* @return \Illuminate\Cache\Repository
*/
protected function createNullDriver()
{
Expand All @@ -188,7 +188,7 @@ protected function createNullDriver()
* Create an instance of the Redis cache driver.
*
* @param array $config
* @return \Illuminate\Cache\RedisStore
* @return \Illuminate\Cache\Repository
*/
protected function createRedisDriver(array $config)
{
Expand All @@ -203,7 +203,7 @@ protected function createRedisDriver(array $config)
* Create an instance of the database cache driver.
*
* @param array $config
* @return \Illuminate\Cache\DatabaseStore
* @return \Illuminate\Cache\Repository
*/
protected function createDatabaseDriver(array $config)
{
Expand Down Expand Up @@ -300,7 +300,7 @@ public function forgetDriver($name = null)
/**
* Register a custom driver creator Closure.
*
* @param string $driver
* @param string $driver
* @param \Closure $callback
* @return $this
*/
Expand All @@ -315,7 +315,7 @@ public function extend($driver, Closure $callback)
* Dynamically call the default driver instance.
*
* @param string $method
* @param array $parameters
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function hasOption($name)
* Get the value of a command option.
*
* @param string|null $key
* @return string|array|null
* @return string|array|bool|null
*/
public function option($key = null)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Contracts/Queue/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public function fire();
/**
* Release the job back into the queue.
*
* Accepts a delay specified in seconds.
*
* @param int $delay
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Concerns/BuildsQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function when($value, $callback, $default = null)
/**
* Pass the query to a given callback.
*
* @param \Closure $callback
* @param callable $callback
* @return \Illuminate\Database\Query\Builder
*/
public function tap($callback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function handle()
$this->migrator->setConnection($this->option('database'));

if (! $this->migrator->repositoryExists()) {
return $this->error('No migrations found.');
return $this->error('Migration table not found.');
}

$ran = $this->migrator->getRepository()->getRan();
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 @@ -38,6 +38,7 @@ protected function causedByLostConnection(Throwable $e)
'ORA-03114',
'Packets out of order. Expected',
'Adaptive Server connection failed',
'Communication link failure',
]);
}
}
24 changes: 22 additions & 2 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Database\Eloquent;

use Closure;
use Exception;
use BadMethodCallException;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
Expand All @@ -14,6 +15,8 @@
use Illuminate\Database\Query\Builder as QueryBuilder;

/**
* @property-read HigherOrderBuilderProxy $orWhere
*
* @mixin \Illuminate\Database\Query\Builder
*/
class Builder
Expand Down Expand Up @@ -904,7 +907,7 @@ public function onDelete(Closure $callback)
* Call the given local model scopes.
*
* @param array $scopes
* @return mixed
* @return static|mixed
*/
public function scopes(array $scopes)
{
Expand Down Expand Up @@ -933,7 +936,7 @@ public function scopes(array $scopes)
/**
* Apply the scopes to the Eloquent builder instance and return it.
*
* @return \Illuminate\Database\Eloquent\Builder|static
* @return static
*/
public function applyScopes()
{
Expand Down Expand Up @@ -1281,6 +1284,23 @@ public function getMacro($name)
return Arr::get($this->localMacros, $name);
}

/**
* Dynamically access builder proxies.
*
* @param string $key
* @return mixed
*
* @throws \Exception
*/
public function __get($key)
{
if ($key === 'orWhere') {
return new HigherOrderBuilderProxy($this, $key);
}

throw new Exception("Property [{$key}] does not exist on the Eloquent builder instance.");
}

/**
* Dynamically handle calls into the query instance.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Contracts\Queue\QueueableEntity;
use Illuminate\Contracts\Queue\QueueableCollection;
use Illuminate\Support\Collection as BaseCollection;

Expand Down Expand Up @@ -541,7 +541,7 @@ public function getQueueableIds()
return [];
}

return $this->first() instanceof Pivot
return $this->first() instanceof QueueableEntity
? $this->map->getQueueableId()->all()
: $this->modelKeys();
}
Expand Down
49 changes: 49 additions & 0 deletions src/Illuminate/Database/Eloquent/HigherOrderBuilderProxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace Illuminate\Database\Eloquent;

/**
* @mixin \Illuminate\Database\Eloquent\Builder
*/
class HigherOrderBuilderProxy
{
/**
* The collection being operated on.
*
* @var \Illuminate\Database\Eloquent\Builder
*/
protected $builder;

/**
* The method being proxied.
*
* @var string
*/
protected $method;

/**
* Create a new proxy instance.
*
* @param Builder $builder
* @param string $method
*/
public function __construct(Builder $builder, $method)
{
$this->method = $method;
$this->builder = $builder;
}

/**
* Proxy a scope call onto the query builder.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->builder->{$this->method}(function ($value) use ($method, $parameters) {
return $value->{$method}(...$parameters);
});
}
}
8 changes: 5 additions & 3 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ protected function decrement($column, $amount = 1, array $extra = [])
*/
protected function incrementOrDecrement($column, $amount, $extra, $method)
{
$query = $this->newModelQuery();
$query = $this->newQueryWithoutRelationships();

if (! $this->exists) {
return $query->{$method}($column, $amount, $extra);
Expand Down Expand Up @@ -1408,10 +1408,12 @@ public function getQueueableRelations()
$relations = [];

foreach ($this->getRelations() as $key => $relation) {
if (method_exists($this, $key)) {
$relations[] = $key;
if (! method_exists($this, $key)) {
continue;
}

$relations[] = $key;

if ($relation instanceof QueueableCollection) {
foreach ($relation->getQueueableRelations() as $collectionValue) {
$relations[] = $key.'.'.$collectionValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ public function touch()
// the related model's timestamps, to make sure these all reflect the changes
// to the parent models. This will help us keep any caching synced up here.
if (count($ids = $this->allRelatedIds()) > 0) {
$this->getRelated()->newModelQuery()->whereIn($key, $ids)->update($columns);
$this->getRelated()->newQueryWithoutRelationships()->whereIn($key, $ids)->update($columns);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function delete()
*/
protected function getDeleteQuery()
{
return $this->newModelQuery()->where([
return $this->newQueryWithoutRelationships()->where([
$this->foreignKey => $this->getOriginal($this->foreignKey, $this->getAttribute($this->foreignKey)),
$this->relatedKey => $this->getOriginal($this->relatedKey, $this->getAttribute($this->relatedKey)),
]);
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ public function save(Model $model)
/**
* Attach a collection of models to the parent instance.
*
* @param \Traversable|array $models
* @return \Traversable|array
* @param iterable $models
* @return iterable
*/
public function saveMany($models)
{
Expand Down
12 changes: 12 additions & 0 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,18 @@ public function multiPolygon($column)
return $this->addColumn('multipolygon', $column);
}

/**
* Create a new generated, computed column on the table.
*
* @param string $column
* @param string $expression
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function computed($column, $expression)
{
return $this->addColumn('computed', $column, compact('expression'));
}

/**
* Add the proper columns for a polymorphic table.
*
Expand Down
Loading

0 comments on commit 8a2aa77

Please sign in to comment.