Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 13, 2017
2 parents 1b6e936 + d3e0493 commit 508005a
Show file tree
Hide file tree
Showing 40 changed files with 1,196 additions and 101 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG-5.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,48 @@

## [Unreleased]

### Added
- Added `Blueprint::spatialIndex()` method ([#21070](https://github.com/laravel/framework/pull/21070))
- Added support for SQL Server's `TransactionIsolation` DSN key ([#21069](https://github.com/laravel/framework/pull/21069))
- Added `ManagesFrequencies::everyFifteenMinutes()` method ([#21092](https://github.com/laravel/framework/pull/21092))

### Changed
- Return `null` from `Route::getAction()` if `$key` is not found ([#21083](https://github.com/laravel/framework/pull/21083))

### Fixed
- Fixed `@json` directive parameter logic ([2a25ee7](https://github.com/laravel/framework/commit/2a25ee7f2f2d5e2cbc1397cc24abbb2838a9b439))
- Fixed a problem with `withoutExceptionHandling()` when called more than once ([#21086](https://github.com/laravel/framework/pull/21086))


## v5.5.3 (2017-09-07)

### Added
- Added `$action` parameter to `Route::getAction()` for simpler access ([#20975](https://github.com/laravel/framework/pull/20975))
- Added `@json` blade directive ([#21004](https://github.com/laravel/framework/pull/21004))
- Added `rescue()` helper ([#21010](https://github.com/laravel/framework/pull/21010), [74ecb34](https://github.com/laravel/framework/commit/74ecb34e1af89969f139e2d1d0f22694704a30d1), [c4d1c47](https://github.com/laravel/framework/commit/c4d1c471d2a9d080362b8bed70be35cd84e2cdef))
- Support commas in `In` and `NotIn` parameters ([#21012](https://github.com/laravel/framework/pull/21012), [3c3c5e4](https://github.com/laravel/framework/commit/3c3c5e4402ed14ad86823aeec0f67b2da04629a0))
- Added `RedisManager::connections()` method ([#21014](https://github.com/laravel/framework/pull/21014), [1deaaa9](https://github.com/laravel/framework/commit/1deaaa9dc08e1f194558df745d17e468d35d9eae))
- Added exception class to JSON exceptions ([#21043](https://github.com/laravel/framework/pull/21043))
- Added `Gate::policies()` method ([#21036](https://github.com/laravel/framework/pull/21036))
- Added geo spatial blueprint methods ([#21056](https://github.com/laravel/framework/pull/21056))

### Changed
- Fixed migrations not being run in batch order ([#20986](https://github.com/laravel/framework/pull/20986))
- Flush application resources on teardown ([#21022](https://github.com/laravel/framework/pull/21022))
- Catch errors while building exception context ([#21047](https://github.com/laravel/framework/pull/21047))
- Return `$this` from `Validator::setCustomMessages()` ([#21046](https://github.com/laravel/framework/pull/21046))

### Fixed
- Make `Request::validate()` return the value of parent key ([#20974](https://github.com/laravel/framework/pull/20974))
- Fixed date comparison validators failing when a format is specified ([#20940](https://github.com/laravel/framework/pull/20940))
- Fixed login throttling failing when `decayMinutes` is more than `1` ([#20997](https://github.com/laravel/framework/pull/20997))
- Only use reflection on classes in `Kernel::load()` ([#20998](https://github.com/laravel/framework/pull/20998))
- Specify lower case `column_name` in `MySqlGrammar::compileColumnListing()` ([#21037](https://github.com/laravel/framework/pull/21037))
- Fixed eager loading problem with `BelongsToMany` ([#21044](https://github.com/laravel/framework/pull/21044))

### Removed
- Remove unnecessary `lcfirst()` call in `authorizeResource()` ([#21017](https://github.com/laravel/framework/pull/21017))
- Removed `$listensFor` from listener stubs ([#21039](https://github.com/laravel/framework/pull/21039))


## v5.5.2 (2017-09-04)
Expand Down
90 changes: 50 additions & 40 deletions src/Illuminate/Console/Scheduling/ManagesFrequencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,56 @@ private function inTimeInterval($startTime, $endTime)
};
}

/**
* Schedule the event to run every minute.
*
* @return $this
*/
public function everyMinute()
{
return $this->spliceIntoPosition(1, '*');
}

/**
* Schedule the event to run every five minutes.
*
* @return $this
*/
public function everyFiveMinutes()
{
return $this->spliceIntoPosition(1, '*/5');
}

/**
* Schedule the event to run every ten minutes.
*
* @return $this
*/
public function everyTenMinutes()
{
return $this->spliceIntoPosition(1, '*/10');
}

/**
* Schedule the event to run every fifteen minutes.
*
* @return $this
*/
public function everyFifteenMinutes()
{
return $this->spliceIntoPosition(1, '*/15');
}

/**
* Schedule the event to run every thirty minutes.
*
* @return $this
*/
public function everyThirtyMinutes()
{
return $this->spliceIntoPosition(1, '0,30');
}

/**
* Schedule the event to run hourly.
*
Expand Down Expand Up @@ -317,46 +367,6 @@ public function yearly()
->spliceIntoPosition(4, 1);
}

/**
* Schedule the event to run every minute.
*
* @return $this
*/
public function everyMinute()
{
return $this->spliceIntoPosition(1, '*');
}

/**
* Schedule the event to run every five minutes.
*
* @return $this
*/
public function everyFiveMinutes()
{
return $this->spliceIntoPosition(1, '*/5');
}

/**
* Schedule the event to run every ten minutes.
*
* @return $this
*/
public function everyTenMinutes()
{
return $this->spliceIntoPosition(1, '*/10');
}

/**
* Schedule the event to run every thirty minutes.
*
* @return $this
*/
public function everyThirtyMinutes()
{
return $this->spliceIntoPosition(1, '0,30');
}

/**
* Set the days of the week the command should run on.
*
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Connectors/SqlServerConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ protected function getSqlSrvDsn(array $config)
$arguments['MultipleActiveResultSets'] = 'false';
}

if (isset($config['transaction_isolation'])) {
$arguments['TransactionIsolation'] = $config['transaction_isolation'];
}

return $this->buildConnectString('sqlsrv', $arguments);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ public function scopes(array $scopes)
}

// Next we'll pass the scope callback to the callScope method which will take
// care of groping the "wheres" correctly so the logical order doesn't get
// care of grouping the "wheres" properly so the logical order doesn't get
// messed up when adding scopes. Then we'll return back out the builder.
$builder = $builder->callScope(
[$this->model, 'scope'.ucfirst($scope)],
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Database/Eloquent/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public function fresh($with = [])
->getDictionary();

return $this->map(function ($model) use ($freshModels) {
return $model->exists ? $freshModels[$model->getKey()] : null;
return $model->exists && isset($freshModels[$model->getKey()])
? $freshModels[$model->getKey()] : null;
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,10 @@ public function is($model)
/**
* Determine if two models are not the same.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Illuminate\Database\Eloquent\Model|null $model
* @return bool
*/
public function isNot(Model $model)
public function isNot($model)
{
return ! $this->is($model);
}
Expand Down
14 changes: 12 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected function addWhereConstraints()
*/
public function addEagerConstraints(array $models)
{
$this->query->whereIn($this->getQualifiedForeignPivotKeyName(), $this->getKeys($models));
$this->query->whereIn($this->getQualifiedForeignPivotKeyName(), $this->getKeys($models, $this->parentKey));
}

/**
Expand Down Expand Up @@ -229,7 +229,7 @@ public function match(array $models, Collection $results, $relation)
// children back to their parent using the dictionary and the keys on the
// the parent models. Then we will return the hydrated models back out.
foreach ($models as $model) {
if (isset($dictionary[$key = $model->getKey()])) {
if (isset($dictionary[$key = $model->{$this->parentKey}])) {
$model->setRelation(
$relation, $this->related->newCollection($dictionary[$key])
);
Expand Down Expand Up @@ -923,6 +923,16 @@ public function getQualifiedRelatedPivotKeyName()
return $this->table.'.'.$this->relatedPivotKey;
}

/**
* Get the fully qualified parent key name for the relation.
*
* @return string
*/
public function getQualifiedParentKeyName()
{
return $this->parent->getTable().'.'.$this->parentKey;
}

/**
* Get the intermediate table for the relationship.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ protected function baseAttachRecord($id, $timed)
{
$record[$this->relatedPivotKey] = $id;

$record[$this->foreignPivotKey] = $this->parent->getKey();
$record[$this->foreignPivotKey] = $this->parent->{$this->parentKey};

// If the record needs to have creation and update timestamps, we will make
// them by calling the parent model's "freshTimestamp" method which will
Expand Down Expand Up @@ -439,7 +439,7 @@ protected function newPivotQuery()
call_user_func_array([$query, 'whereIn'], $arguments);
}

return $query->where($this->foreignPivotKey, $this->parent->getKey());
return $query->where($this->foreignPivotKey, $this->parent->{$this->parentKey});
}

/**
Expand Down
26 changes: 18 additions & 8 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function selectSub($query, $as)
if ($query instanceof Closure) {
$callback = $query;

$callback($query = $this->newQuery());
$callback($query = $this->forSubQuery());
}

// Here, we will parse this query into an SQL string and an array of bindings
Expand Down Expand Up @@ -820,7 +820,7 @@ protected function whereInSub($column, Closure $callback, $boolean, $not)
// To create the exists sub-select, we will actually create a query and call the
// provided callback with the query so the developer may set any of the query
// conditions they want for the in clause, then we'll put it in this array.
call_user_func($callback, $query = $this->newQuery());
call_user_func($callback, $query = $this->forSubQuery());

$this->wheres[] = compact('type', 'column', 'query', 'boolean');

Expand Down Expand Up @@ -1148,7 +1148,7 @@ protected function whereSub($column, $operator, Closure $callback, $boolean)
// Once we have the query instance we can simply execute it so it can add all
// of the sub-select's conditions to itself, and then we can cache it off
// in the array of where clauses for the "main" parent query instance.
call_user_func($callback, $query = $this->newQuery());
call_user_func($callback, $query = $this->forSubQuery());

$this->wheres[] = compact(
'type', 'column', 'operator', 'query', 'boolean'
Expand All @@ -1169,7 +1169,7 @@ protected function whereSub($column, $operator, Closure $callback, $boolean)
*/
public function whereExists(Closure $callback, $boolean = 'and', $not = false)
{
$query = $this->newQuery();
$query = $this->forSubQuery();

// Similar to the sub-select clause, we will create a new query instance so
// the developer may cleanly specify the entire exists query and we will
Expand Down Expand Up @@ -2250,6 +2250,16 @@ public function newQuery()
return new static($this->connection, $this->grammar, $this->processor);
}

/**
* Create a new query instance for a sub-query.
*
* @return \Illuminate\Database\Query\Builder
*/
protected function forSubQuery()
{
return $this->newQuery();
}

/**
* Create a raw database expression.
*
Expand Down Expand Up @@ -2396,13 +2406,13 @@ public function useWritePdo()
/**
* Clone the query without the given properties.
*
* @param array $except
* @param array $properties
* @return static
*/
public function cloneWithout(array $except)
public function cloneWithout(array $properties)
{
return tap(clone $this, function ($clone) use ($except) {
foreach ($except as $property) {
return tap(clone $this, function ($clone) use ($properties) {
foreach ($properties as $property) {
$clone->{$property} = null;
}
});
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Query/JoinClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,14 @@ public function newQuery()
{
return new static($this->parentQuery, $this->type, $this->table);
}

/**
* Create a new query instance for sub-query.
*
* @return \Illuminate\Database\Query\Builder
*/
protected function forSubQuery()
{
return $this->parentQuery->newQuery();
}
}
Loading

0 comments on commit 508005a

Please sign in to comment.