formatting
This commit is contained in:
parent
d8f5b62d07
commit
f81c8bcc99
|
@ -1389,8 +1389,10 @@ The `optional` function accepts any argument and allows you to access properties
|
|||
|
||||
{!! old('name', optional($user)->name) !!}
|
||||
|
||||
The `optional` function also accepts a Closure as its second argument. The Closure will be invoked if the value provided as the first argument is not null:
|
||||
|
||||
return optional(User::find($id), function ($user) {
|
||||
return App\Post::findUser($user->id);
|
||||
return new DummyUser;
|
||||
});
|
||||
|
||||
<a name="method-policy"></a>
|
||||
|
|
Loading…
Reference in New Issue