You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: original-en/broadcasting.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ By default, broadcasting is not enabled in new Laravel applications. You may ena
69
69
php artisan install:broadcasting
70
70
```
71
71
72
-
The `install:broadcasting` command with prompt you for which event broadcasting service you would like to use. In addition, it will create the `config/broadcasting.php` configuration file and the `routes/channels.php` file where you may register your application's broadcast authorization routes and callbacks.
72
+
The `install:broadcasting` command will prompt you for which event broadcasting service you would like to use. In addition, it will create the `config/broadcasting.php` configuration file and the `routes/channels.php` file where you may register your application's broadcast authorization routes and callbacks.
73
73
74
74
Laravel supports several broadcast drivers out of the box: [Laravel Reverb](/docs/{{version}}/reverb), [Pusher Channels](https://pusher.com/channels), [Ably](https://ably.com), and a `log` driver for local development and debugging. Additionally, a `null` driver is included which allows you to disable broadcasting during testing. A configuration example is included for each of these drivers in the `config/broadcasting.php` configuration file.
The `doesntContain` method uses "loose" comparisons when checking item values, meaning a string with an integer value will be considered equal to an integer of the same value.
845
846
847
+
<aname="method-doesntcontainstrict"></a>
848
+
#### `doesntContainStrict()` {.collection-method}
849
+
850
+
This method has the same signature as the [doesntContain](#method-doesntcontain) method; however, all values are compared using "strict" comparisons.
Copy file name to clipboardExpand all lines: original-en/container.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,9 @@ $this->app->singletonIf(Transistor::class, function (Application $app) {
178
178
});
179
179
```
180
180
181
+
<aname="singleton-attribute"></a>
182
+
#### Singleton Attribute
183
+
181
184
Alternatively, you may mark an interface or class with the `#[Singleton]` attribute to indicate to the container that it should be resolved one time:
182
185
183
186
```php
@@ -217,6 +220,9 @@ $this->app->scopedIf(Transistor::class, function (Application $app) {
217
220
});
218
221
```
219
222
223
+
<aname="scoped-attribute"></a>
224
+
#### Scoped Attribute
225
+
220
226
Alternatively, you may mark an interface or class with the `#[Scoped]` attribute to indicate to the container that it should be resolved one time within a given Laravel request / job lifecycle:
221
227
222
228
```php
@@ -272,6 +278,45 @@ public function __construct(
272
278
) {}
273
279
```
274
280
281
+
<aname="bind-attribute"></a>
282
+
#### Bind Attribute
283
+
284
+
Laravel also provides a `Bind` attribute for added convenience. You can apply this attribute to any interface to tell Laravel which implementation should be automatically injected whenever that interface is requested. When using the `Bind` attribute, there is no need to perform any additional service registration in your application's service providers.
285
+
286
+
In addition, multiple `Bind` attributes may be placed on an interface in order to configure a different implementation that should be injected for a given set of environments:
Furthermore, [Singleton](#singleton-attribute) and [Scoped](#scoped-attribute) attributes may be applied to indicate if the container bindings should be resolved once or once per request / job lifecycle:
@@ -799,6 +800,26 @@ class OrderShipped implements ShouldDispatchAfterCommit
799
800
}
800
801
```
801
802
803
+
<aname="deferring-events"></a>
804
+
### Deferring Events
805
+
806
+
Deferred events allow you to delay the dispatching of model events and execution of event listeners until after a specific block of code has completed. This is particularly useful when you need to ensure that all related records are created before event listeners are triggered.
807
+
808
+
To defer events, provide a closure to the `Event::defer()` method:
$user->posts()->create(['title' => 'My first post!']);
818
+
});
819
+
```
820
+
821
+
All events triggered within the closure will be dispatched after the closure is executed. This ensures that event listeners have access to all related records that were created during the deferred execution. If an exception occurs within the closure, the deferred events will not be dispatched.
822
+
802
823
<aname="event-subscribers"></a>
803
824
## Event Subscribers
804
825
@@ -935,6 +956,9 @@ test('orders can be shipped', function () {
If necessary, you may pass the HTTP status code that should be assigned to the redirect and any additional response headers as the third and fourth arguments to the `to_action` method:
2152
+
2153
+
```php
2154
+
return to_action(
2155
+
[UserController::class, 'show'],
2156
+
['user' => 1],
2157
+
302,
2158
+
['X-Framework' => 'Laravel']
2159
+
);
2160
+
```
2161
+
2103
2162
<aname="method-to-route"></a>
2104
2163
#### `to_route()` {.collection-method}
2105
2164
@@ -3165,6 +3224,9 @@ By default, deferred functions will only be executed if the HTTP response, Artis
> If you have the **swoole** PHP extension installed, Laravel's `defer` function may conflict with Swoole's own global `defer` function, leading to web server errors. Make sure you call Laravel's `defer` helper by explicitly namespacing it: `use function Illuminate\Support\defer;`
Copy file name to clipboardExpand all lines: original-en/http-tests.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,13 @@ class ExampleTest extends TestCase
258
258
You may also specify which guard should be used to authenticate the given user by passing the guard name as the second argument to the `actingAs` method. The guard that is provided to the `actingAs` method will also become the default guard for the duration of the test:
259
259
260
260
```php
261
-
$this->actingAs($user, 'web')
261
+
$this->actingAs($user, 'web');
262
+
```
263
+
264
+
If you would like to ensure the request is unauthenticated, you may use the `actingAsGuest` method:
This allows you to customize FrankenPHP's configuration beyond the default settings, such as adding custom middleware, configuring advanced routing, or setting up custom directives. You may consult the [official Caddy documentation](https://caddyserver.com/docs/caddyfile) for more information on Caddyfile syntax and configuration options.
150
+
139
151
<a name="roadrunner"></a>
140
152
### RoadRunner
141
153
@@ -360,6 +372,20 @@ To help prevent stray memory leaks, Octane gracefully restarts any worker once i
360
372
php artisan octane:start --max-requests=250
361
373
```
362
374
375
+
<a name="specifying-the-max-execution-time"></a>
376
+
### Specifying the Max Execution Time
377
+
378
+
By default, Laravel Octane sets a maximum execution time of 30 seconds for incoming requests via the `max_execution_time` option in your application's `config/octane.php` configuration file:
379
+
380
+
```php
381
+
'max_execution_time' => 30,
382
+
```
383
+
384
+
This setting defines the maximum number of seconds that an incoming request is allowed to execute before being terminated. Setting this value to `0` will disable the execution time limit entirely. This configuration option is particularly useful for applications that handle long-running requests, such as file uploads, data processing, or API calls to external services.
385
+
386
+
> [!WARNING]
387
+
> When you modify the `max_execution_time` configuration, you must restart the Octane server for the changes to take effect.
0 commit comments