The Laravel group launched v10.12 with conditional techniques contributed to Rest, a brand-new task timeout occasion, timezone recognition criteria, and also a lot more:
Conditional rest
Bradie Tilley added the capacity to include problems to the brand-new Rest course presented in Laravel 10.10:
Rest:: for( 1)->> 2nd()->> unless($ job->> finished());
Rest:: for( 1)->> 2nd()->> when($ job->> pending());
// Closures
Rest:: for( 1)->> 2nd()->> unless( fn () => > $job->> finished());
Rest:: for( 1)->> 2nd()->> when( fn () => > $job->> pending());
Task timeout took place occasion
Saeed Hosseini added a JobTimedOut
occasion that a line up employee fires when the task has actually break:
usage IlluminateQueueEventsJobTimedOut;
/ **
* The occasion to audience mappings for the application.
*
* @var selection< > */ secured $pay attention =
,
]; Inline add-on assistance for Markdown mailables Nuno Maduro [
JobTimedOut::class => [
SendJobTimedOutNotification::class,
] added inline add-on assistance for Markdown mailables:
This pull demand repairs markdown accessibility to
$ message
variable on theme, by just careless make the markdown on the minute the $ message
variable as currently offered as sight information.
See
Pull Demand # 47140for information.
Approach not permitted HTTP assertion
Azim Kordpour added an assertion for HTTP standing 405
(Approach Not Enabled) that you can make use of to confirm a course does not reply to particular HTTP verbs:
$ this->> obtain
(
'/')->> assertOk(); $ this->> article
(
'/')->> assertMethodNotAllowed();$ this->> spot(
'/')->> assertMethodNotAllowed();$ this->> placed(
'/')->> assertMethodNotAllowed();$ this->> remove(
'/')->> assertMethodNotAllowed(); Significant forceCreateQuietly() approach Volodya Kurshudyan added a forceCreateQuietly()
approach to Eloquent that compels the production of a design without activating any type of version occasions:
Message:: forceCreateQuietly
($ information);
Include criteria to timezone recognition policy Artyom Yavdoshchuk included assistance for utilizing criteria with the timezone
recognition policy:
‘ timezone’// functions as in the past' timezone: Africa'
// approves only Africans timezones
' timezone: All' // functions the like with no criteria
' timezone: All_with_BC' // approves timezones with Backwards Compatibility (Europe/Kiev will certainly be approved)
' timezone: Per_country, United States' // approves only United States timezones
Right here's an instance from the pull demand examination situations: $ v
= brand-new
Validator
( $trans, , );
$ this
['foo' => 'australia/sydney']->>
['foo' => 'Timezone:Australia']
assertFalse
($ v
->> passes()); Launch Notes You can see the total listing of brand-new attributes and also updates listed below and also the diff in between 10.11.0 and also 10.12.0 on GitHub. The complying with launch notes are straight from the
changelog
: v10.12.0 Included Included Illuminate/Queue/Events/ JobTimedOut.php
(
# 47068
- )
Included
when() and also unless() - techniques to
Illuminate/Support/Sleep
(# 47114
)Includes inline add-ons sustain for markdown mailables (
# 47140) Included - Illuminate/Testing/Concerns/ AssertsStatusCodes:: assertMethodNotAllowed() ( # 47169
- )
Included
forceCreateQuietly approach ( # 47162 - )
Included criteria to timezone recognition policy (
# 47171) Repaired - Deals with singleton and also api singletons creatable|destryoable|just|other than mixes ( # 47098)
Do not make use of vacant secret or key for DynamoDBClient (
Included mistake handling and also make sure re-enabling of international vital restraints in
- Illuminate/Database/Schema/ Building contractor:: withoutForeignKeyConstraints() ( # 47182
- )
Refactoring
Eliminate pointless else declarations ( # 47161)