Skip to content

Commit

Permalink
Merge branch 'master' into preloader
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 27, 2016
2 parents 09964cc + 11977d5 commit eae5b66
Show file tree
Hide file tree
Showing 14 changed files with 2,846 additions and 2,746 deletions.
30 changes: 24 additions & 6 deletions src/Illuminate/Foundation/Auth/SendsPasswordResetEmails.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,31 @@ public function sendResetLinkEmail(Request $request)
$request->only('email')
);

if ($response === Password::RESET_LINK_SENT) {
return back()->with('status', trans($response));
}
return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($response)
: $this->sendResetLinkFailedResponse($request, $response);
}

// If an error was returned by the password broker, we will get this message
// translated so we can notify a user of the problem. We'll redirect back
// to where the users came from so they can attempt this process again.
/**
* Get the response for a successful password reset link.
*
* @param string $response
* @return \Illuminate\Http\Response
*/
protected function sendResetLinkResponse($response)
{
return back()->with('status', trans($response));
}

/**
* Get the response for a failed password reset link.
*
* @param \Illuminate\Http\Request
* @param string $response
* @return \Illuminate\Http\RedirectResponse
*/
protected function sendResetLinkFailedResponse(Request $request, $response)
{
return back()->withErrors(
['email' => trans($response)]
);
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Foundation/Console/stubs/policy.stub
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DummyClass
* Determine whether the user can view the dummyModelName.
*
* @param \DummyRootNamespaceUser $user
* @param \DummyRootNamespaceDummyModel $dummyModelName
* @param \NamespacedDummyModel $dummyModelName
* @return mixed
*/
public function view(User $user, DummyModel $dummyModelName)
Expand All @@ -37,7 +37,7 @@ class DummyClass
* Determine whether the user can update the dummyModelName.
*
* @param \DummyRootNamespaceUser $user
* @param \DummyRootNamespaceDummyModel $dummyModelName
* @param \NamespacedDummyModel $dummyModelName
* @return mixed
*/
public function update(User $user, DummyModel $dummyModelName)
Expand All @@ -49,7 +49,7 @@ class DummyClass
* Determine whether the user can delete the dummyModelName.
*
* @param \DummyRootNamespaceUser $user
* @param \DummyRootNamespaceDummyModel $dummyModelName
* @param \NamespacedDummyModel $dummyModelName
* @return mixed
*/
public function delete(User $user, DummyModel $dummyModelName)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
* @var array
*/
protected static $proxies = [
'each', 'every', 'filter', 'first', 'map', 'partition',
'reject', 'sortBy', 'sortByDesc', 'sum',
'contains', 'each', 'every', 'filter', 'first', 'map',
'partition', 'reject', 'sortBy', 'sortByDesc', 'sum',
];

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Support/MessageBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ public function first($key = null, $format = null)
{
$messages = is_null($key) ? $this->all($format) : $this->get($key, $format);

return head(array_flatten($messages)) ?: '';
$firstMessage = Arr::first($messages, null, '');

return is_array($firstMessage) ? Arr::first($firstMessage) : $firstMessage;
}

/**
Expand Down
Loading

0 comments on commit eae5b66

Please sign in to comment.