Skip to content

Commit c6643d2

Browse files
committed
Merge remote-tracking branch 'origin/5.5' into 5.5
2 parents fac8754 + e6e0e61 commit c6643d2

File tree

11 files changed

+70
-21
lines changed

11 files changed

+70
-21
lines changed

CHANGELOG-5.5.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Release Notes for 5.5.x
22

3+
## [Unreleased]
4+
5+
### Added
6+
- Added `:input` placeholder in validation error messages ([#21175](https://github.com/laravel/framework/pull/21175))
7+
- Added `@includeFirst` Blade directive ([#21172](https://github.com/laravel/framework/pull/21172))
8+
- Allow setting column styles for tables in Artisan commands ([#21169](https://github.com/laravel/framework/pull/21169))
9+
10+
### Changed
11+
- Support `null` on `Model::UPDATED_AT` ([#21178](https://github.com/laravel/framework/pull/21178))
12+
- Render views from config while building error views ([#21145](https://github.com/laravel/framework/pull/21145))
13+
14+
### Fixed
15+
- Ignore `SELECT` bindings in `prepareBindingsForUpdate()` ([#21173](https://github.com/laravel/framework/pull/21173))
16+
17+
318
## v5.5.4 (2017-09-13)
419

520
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Laravel is accessible, yet powerful, providing tools needed for large, robust ap
2626

2727
Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is thorough, complete, and makes it a breeze to get started learning the framework.
2828

29-
If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 900 video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
29+
If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 1100 video tutorials covering a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
3030

3131
## Contributing
3232

src/Illuminate/Console/Command.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,25 @@ public function choice($question, array $choices, $default = null, $attempts = n
378378
*
379379
* @param array $headers
380380
* @param \Illuminate\Contracts\Support\Arrayable|array $rows
381-
* @param string $style
381+
* @param string $tableStyle
382+
* @param array $columnStyles
382383
* @return void
383384
*/
384-
public function table($headers, $rows, $style = 'default')
385+
public function table($headers, $rows, $tableStyle = 'default', array $columnStyles = [])
385386
{
386387
$table = new Table($this->output);
387388

388389
if ($rows instanceof Arrayable) {
389390
$rows = $rows->toArray();
390391
}
391392

392-
$table->setHeaders((array) $headers)->setRows($rows)->setStyle($style)->render();
393+
$table->setHeaders((array) $headers)->setRows($rows)->setStyle($tableStyle);
394+
395+
foreach ($columnStyles as $columnIndex => $columnStyle) {
396+
$table->setColumnStyle($columnIndex, $columnStyle);
397+
}
398+
399+
$table->render();
393400
}
394401

395402
/**

src/Illuminate/Database/Console/Factories/FactoryMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function getPath($name)
7878
protected function getOptions()
7979
{
8080
return [
81-
['model', null, InputOption::VALUE_OPTIONAL, 'The name of the model'],
81+
['model', 'm', InputOption::VALUE_OPTIONAL, 'The name of the model'],
8282
];
8383
}
8484
}

src/Illuminate/Foundation/Auth/AuthenticatesUsers.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function showLoginForm()
2424
* Handle a login request to the application.
2525
*
2626
* @param \Illuminate\Http\Request $request
27-
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
27+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
2828
*/
2929
public function login(Request $request)
3030
{
@@ -74,7 +74,7 @@ protected function validateLogin(Request $request)
7474
protected function attemptLogin(Request $request)
7575
{
7676
return $this->guard()->attempt(
77-
$this->credentials($request), $request->has('remember')
77+
$this->credentials($request), $request->filled('remember')
7878
);
7979
}
8080

@@ -121,7 +121,9 @@ protected function authenticated(Request $request, $user)
121121
* Get the failed login response instance.
122122
*
123123
* @param \Illuminate\Http\Request $request
124-
* @return \Illuminate\Http\RedirectResponse
124+
* @return \Symfony\Component\HttpFoundation\Response
125+
*
126+
* @throws ValidationException
125127
*/
126128
protected function sendFailedLoginResponse(Request $request)
127129
{

src/Illuminate/Foundation/Auth/ResetsPasswords.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function showResetForm(Request $request, $token = null)
3333
* Reset the given user's password.
3434
*
3535
* @param \Illuminate\Http\Request $request
36-
* @return \Illuminate\Http\RedirectResponse
36+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
3737
*/
3838
public function reset(Request $request)
3939
{
@@ -117,7 +117,7 @@ protected function resetPassword($user, $password)
117117
* Get the response for a successful password reset.
118118
*
119119
* @param string $response
120-
* @return \Illuminate\Http\RedirectResponse
120+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
121121
*/
122122
protected function sendResetResponse($response)
123123
{
@@ -130,7 +130,7 @@ protected function sendResetResponse($response)
130130
*
131131
* @param \Illuminate\Http\Request
132132
* @param string $response
133-
* @return \Illuminate\Http\RedirectResponse
133+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
134134
*/
135135
protected function sendResetFailedResponse(Request $request, $response)
136136
{

src/Illuminate/Foundation/Auth/SendsPasswordResetEmails.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function showLinkRequestForm()
2121
* Send a reset link to the given user.
2222
*
2323
* @param \Illuminate\Http\Request $request
24-
* @return \Illuminate\Http\RedirectResponse
24+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
2525
*/
2626
public function sendResetLinkEmail(Request $request)
2727
{
@@ -54,7 +54,7 @@ protected function validateEmail(Request $request)
5454
* Get the response for a successful password reset link.
5555
*
5656
* @param string $response
57-
* @return \Illuminate\Http\RedirectResponse
57+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
5858
*/
5959
protected function sendResetLinkResponse($response)
6060
{
@@ -66,7 +66,7 @@ protected function sendResetLinkResponse($response)
6666
*
6767
* @param \Illuminate\Http\Request
6868
* @param string $response
69-
* @return \Illuminate\Http\RedirectResponse
69+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
7070
*/
7171
protected function sendResetLinkFailedResponse(Request $request, $response)
7272
{

src/Illuminate/Support/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
13481348
// function which we were given. Then, we will sort the returned values and
13491349
// and grab the corresponding values for the sorted keys from this array.
13501350
foreach ($this->items as $key => $value) {
1351-
$results[$key] = $callback($value, $key);
1351+
$results[$key] = [$callback($value, $key), $key];
13521352
}
13531353

13541354
$descending ? arsort($results, $options)

src/Illuminate/Support/Str.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function contains($haystack, $needles)
118118
public static function endsWith($haystack, $needles)
119119
{
120120
foreach ((array) $needles as $needle) {
121-
if (substr($haystack, -strlen($needle)) === (string) $needle) {
121+
if (mb_substr($haystack, -mb_strlen($needle)) === (string) $needle) {
122122
return true;
123123
}
124124
}
@@ -328,10 +328,10 @@ public static function replaceFirst($search, $replace, $subject)
328328
return $subject;
329329
}
330330

331-
$position = strpos($subject, $search);
331+
$position = mb_strpos($subject, $search);
332332

333333
if ($position !== false) {
334-
return substr_replace($subject, $replace, $position, strlen($search));
334+
return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position + mb_strlen($search));
335335
}
336336

337337
return $subject;
@@ -347,10 +347,10 @@ public static function replaceFirst($search, $replace, $subject)
347347
*/
348348
public static function replaceLast($search, $replace, $subject)
349349
{
350-
$position = strrpos($subject, $search);
350+
$position = mb_strrpos($subject, $search);
351351

352352
if ($position !== false) {
353-
return substr_replace($subject, $replace, $position, strlen($search));
353+
return mb_substr($subject, 0, $position).$replace.mb_substr($subject, $position + mb_strlen($search));
354354
}
355355

356356
return $subject;
@@ -466,7 +466,7 @@ public static function snake($value, $delimiter = '_')
466466
public static function startsWith($haystack, $needles)
467467
{
468468
foreach ((array) $needles as $needle) {
469-
if ($needle !== '' && substr($haystack, 0, strlen($needle)) === (string) $needle) {
469+
if ($needle !== '' && mb_substr($haystack, 0, mb_strlen($needle)) === (string) $needle) {
470470
return true;
471471
}
472472
}

tests/Support/SupportCollectionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,15 @@ public function testSortByAlwaysReturnsAssoc()
817817
$this->assertEquals([1 => 'dayle', 0 => 'taylor'], $data->all());
818818
}
819819

820+
public function testSortByMaintainsOriginalOrderOfItemsWithIdenticalValues()
821+
{
822+
$data = new Collection([['name' => 'taylor'], ['name' => 'dayle'], ['name' => 'dayle']]);
823+
$data = $data->sortBy('name');
824+
825+
$this->assertEquals([['name' => 'dayle'], ['name' => 'dayle'], ['name' => 'taylor']], array_values($data->all()));
826+
$this->assertEquals([1, 2, 0], $data->keys()->all());
827+
}
828+
820829
public function testReverse()
821830
{
822831
$data = new Collection(['zaeed', 'alan']);

0 commit comments

Comments
 (0)