Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions broadcasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,9 @@ If you would like to listen for events on a private channel, use the `private` m

```js
Echo.private(`orders.${this.order.id}`)
.listen(...)
.listen(...)
.listen(...);
.listen(/* ... */)
.listen(/* ... */)
.listen(/* ... */);
Comment on lines -751 to +753
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't first class callables, being JS, but I adjusted these to match the rest of the docs.

```

<a name="stop-listening-for-events"></a>
Expand Down Expand Up @@ -865,9 +865,9 @@ As typical of other types of events, you may listen for events sent to presence

```js
Echo.join(`chat.${roomId}`)
.here(...)
.joining(...)
.leaving(...)
.here(/* ... */)
.joining(/* ... */)
.leaving(/* ... */)
.listen('NewMessage', (e) => {
//
});
Expand Down
2 changes: 1 addition & 1 deletion cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The `Cache` facade's `get` method is used to retrieve items from the cache. If t
You may even pass a closure as the default value. The result of the closure will be returned if the specified item does not exist in the cache. Passing a closure allows you to defer the retrieval of default values from a database or other external service:

$value = Cache::get('key', function () {
return DB::table(...)->get();
return DB::table(/* ... */)->get();
});

<a name="checking-for-item-existence"></a>
Expand Down
2 changes: 1 addition & 1 deletion database.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ If your application defines multiple connections in your `config/database.php` c

use Illuminate\Support\Facades\DB;

$users = DB::connection('sqlite')->select(...);
$users = DB::connection('sqlite')->select(/* ... */);

You may access the raw, underlying PDO instance of a connection using the `getPdo` method on a connection instance:

Expand Down
2 changes: 1 addition & 1 deletion errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Instead of type-checking exceptions in the exception handler's `register` method
*/
public function render($request)
{
return response(...);
return response(/* ... */);
}
}

Expand Down
26 changes: 13 additions & 13 deletions http-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,43 +148,43 @@ For convenience, you may use the `acceptJson` method to quickly specify that you
You may specify basic and digest authentication credentials using the `withBasicAuth` and `withDigestAuth` methods, respectively:

// Basic authentication...
$response = Http::withBasicAuth('taylor@laravel.com', 'secret')->post(...);
$response = Http::withBasicAuth('taylor@laravel.com', 'secret')->post(/* ... */);

// Digest authentication...
$response = Http::withDigestAuth('taylor@laravel.com', 'secret')->post(...);
$response = Http::withDigestAuth('taylor@laravel.com', 'secret')->post(/* ... */);

<a name="bearer-tokens"></a>
#### Bearer Tokens

If you would like to quickly add a bearer token to the request's `Authorization` header, you may use the `withToken` method:

$response = Http::withToken('token')->post(...);
$response = Http::withToken('token')->post(/* ... */);

<a name="timeout"></a>
### Timeout

The `timeout` method may be used to specify the maximum number of seconds to wait for a response:

$response = Http::timeout(3)->get(...);
$response = Http::timeout(3)->get(/* ... */);

If the given timeout is exceeded, an instance of `Illuminate\Http\Client\ConnectionException` will be thrown.

You may specify the maximum number of seconds to wait while trying to connect to a server using the `connectTimeout` method:

$response = Http::connectTimeout(3)->get(...);
$response = Http::connectTimeout(3)->get(/* ... */);

<a name="retries"></a>
### Retries

If you would like HTTP client to automatically retry the request if a client or server error occurs, you may use the `retry` method. The `retry` method accepts the maximum number of times the request should be attempted and the number of milliseconds that Laravel should wait in between attempts:

$response = Http::retry(3, 100)->post(...);
$response = Http::retry(3, 100)->post(/* ... */);

If needed, you may pass a third argument to the `retry` method. The third argument should be a callable that determines if the retries should actually be attempted. For example, you may wish to only retry the request if the initial request encounters an `ConnectionException`:

$response = Http::retry(3, 100, function ($exception, $request) {
return $exception instanceof ConnectionException;
})->post(...);
})->post(/* ... */);

If a request attempt fails, you may wish to make a change to the request before a new attempt is made. You can achieve this by modifying request argument provided to the callable you provided to the `retry` method. For example, you might want to retry the request with a new authorization token if the first attempt returned an authentication error:

Expand All @@ -196,11 +196,11 @@ If a request attempt fails, you may wish to make a change to the request before
$request->withToken($this->getNewToken());

return true;
})->post(...);
})->post(/* ... */);

If all of the requests fail, an instance of `Illuminate\Http\Client\RequestException` will be thrown. If you would like to disable this behavior, you may provide a `throw` argument with a value of `false`. When disabled, the last response received by the client will be returned after all retries have been attempted:

$response = Http::retry(3, 100, throw: false)->post(...);
$response = Http::retry(3, 100, throw: false)->post(/* ... */);

> {note} If all of the requests fail because of a connection issue, a `Illuminate\Http\Client\ConnectionException` will still be thrown even when the `throw` argument is set to `false`.

Expand Down Expand Up @@ -229,7 +229,7 @@ Unlike Guzzle's default behavior, Laravel's HTTP client wrapper does not throw e

If you have a response instance and would like to throw an instance of `Illuminate\Http\Client\RequestException` if the response status code indicates a client or server error, you may use the `throw` or `throwIf` methods:

$response = Http::post(...);
$response = Http::post(/* ... */);

// Throw an exception if a client or server error occurred...
$response->throw();
Expand All @@ -243,11 +243,11 @@ The `Illuminate\Http\Client\RequestException` instance has a public `$response`

The `throw` method returns the response instance if no error occurred, allowing you to chain other operations onto the `throw` method:

return Http::post(...)->throw()->json();
return Http::post(/* ... */)->throw()->json();

If you would like to perform some additional logic before the exception is thrown, you may pass a closure to the `throw` method. The exception will be thrown automatically after the closure is invoked, so you do not need to re-throw the exception from within the closure:

return Http::post(...)->throw(function ($response, $e) {
return Http::post(/* ... */)->throw(function ($response, $e) {
//
})->json();

Expand Down Expand Up @@ -336,7 +336,7 @@ For example, to instruct the HTTP client to return empty, `200` status code resp

Http::fake();

$response = Http::post(...);
$response = Http::post(/* ... */);

<a name="faking-specific-urls"></a>
#### Faking Specific URLs
Expand Down
2 changes: 1 addition & 1 deletion logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,6 @@ Once you have configured the `custom` driver channel, you're ready to define the
*/
public function __invoke(array $config)
{
return new Logger(...);
return new Logger(/* ... */);
}
}
2 changes: 1 addition & 1 deletion mail.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ Once you've defined your custom transport, you may register it via the `extend`
public function boot()
{
Mail::extend('mailchimp', function (array $config = []) {
return new MailchimpTransport(...);
return new MailchimpTransport(/* ... */);
})
}

Expand Down
4 changes: 2 additions & 2 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Instead of using the `DB::raw` method, you may also use the following methods to
<a name="selectraw"></a>
#### `selectRaw`

The `selectRaw` method can be used in place of `addSelect(DB::raw(...))`. This method accepts an optional array of bindings as its second argument:
The `selectRaw` method can be used in place of `addSelect(DB::raw(/* ... */))`. This method accepts an optional array of bindings as its second argument:

$orders = DB::table('orders')
->selectRaw('price * ? as price_with_tax', [1.0825])
Expand Down Expand Up @@ -348,7 +348,7 @@ You may also specify more advanced join clauses. To get started, pass a closure

DB::table('users')
->join('contacts', function ($join) {
$join->on('users.id', '=', 'contacts.user_id')->orOn(...);
$join->on('users.id', '=', 'contacts.user_id')->orOn(/* ... */);
})
->get();

Expand Down
12 changes: 6 additions & 6 deletions queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ Once you have written your job class, you may dispatch it using the `dispatch` m
*/
public function store(Request $request)
{
$podcast = Podcast::create(...);
$podcast = Podcast::create(/* ... */);

// ...

Expand Down Expand Up @@ -660,7 +660,7 @@ If you would like to specify that a job should not be immediately available for
*/
public function store(Request $request)
{
$podcast = Podcast::create(...);
$podcast = Podcast::create(/* ... */);

// ...

Expand Down Expand Up @@ -713,7 +713,7 @@ If you would like to dispatch a job immediately (synchronously), you may use the
*/
public function store(Request $request)
{
$podcast = Podcast::create(...);
$podcast = Podcast::create(/* ... */);

// Create podcast...

Expand Down Expand Up @@ -775,7 +775,7 @@ In addition to chaining job class instances, you may also chain closures:
new ProcessPodcast,
new OptimizePodcast,
function () {
Podcast::update(...);
Podcast::update(/* ... */);
},
])->dispatch();

Expand Down Expand Up @@ -835,7 +835,7 @@ By pushing jobs to different queues, you may "categorize" your queued jobs and e
*/
public function store(Request $request)
{
$podcast = Podcast::create(...);
$podcast = Podcast::create(/* ... */);

// Create podcast...

Expand Down Expand Up @@ -894,7 +894,7 @@ If your application interacts with multiple queue connections, you may specify w
*/
public function store(Request $request)
{
$podcast = Podcast::create(...);
$podcast = Podcast::create(/* ... */);

// Create podcast...

Expand Down
2 changes: 1 addition & 1 deletion upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ The [HTTP client](/docs/{{version}}/http-client) now has a default timeout of 30

If you wish to specify a longer timeout for a given request, you may do so using the `timeout` method:

$response = Http::timeout(120)->get(...);
$response = Http::timeout(120)->get(/* ... */);

#### HTTP Fake & Middleware

Expand Down
2 changes: 1 addition & 1 deletion validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ Many of Laravel's built-in error messages include an `:attribute` placeholder th

You may also attach callbacks to be run after validation is completed. This allows you to easily perform further validation and even add more error messages to the message collection. To get started, call the `after` method on a validator instance:

$validator = Validator::make(...);
$validator = Validator::make(/* ... */);

$validator->after(function ($validator) {
if ($this->somethingElseIsInvalid()) {
Expand Down