Practice

Use a feature, right now

Short exercises, separate from the tracks: code written the old way, to rewrite with the feature. Often something new in the framework, sometimes a specific point worth a closer look.

  • 64 exercises
  • 55 new features

64 exercises · 41 to 60

Sort: Recent Title

Earlier

20
  1. Symfony 8.2 New A login link that keeps its destination createLoginLink() now signs its parameters: the return_to of a login link can no longer be tampered with. Security Do the exercise
  2. Laravel 13.35 New Searching with a request body thanks to the QUERY method Route::query() declares a route for the HTTP QUERY method: a read, like GET, but with its criteria in the request body. RoutingHTTP Do the exercise
  3. Symfony 8.2 New Encrypting the sensitive columns of an entity #[Encrypted]: Doctrine encrypts a column before writing it and decrypts it when reading, with no custom type or listener. DoctrineEncryption Do the exercise
  4. Symfony 8.2 New Asking for the password again before sensitive pages IS_AUTHENTICATED_RECENTLY and IS_AUTHENTICATED_VERY_RECENTLY: a “sudo mode” that asks for the password again when the login is old. Security Do the exercise
  5. Laravel 13.34 New Counting the rows of several tables in one assertion assertDatabaseCount() accepts an array: the expected number of rows in each table, checked in a single assertion. TestingDatabase Do the exercise
  6. Symfony 8.2 New One name per API version, and groups to leave out #[SerializedName('name', groups: 'v1')]: a property changes name depending on the group; ignored_groups leaves a group out without touching the class. SerializerAPI Do the exercise
  7. Laravel 13.33 New Reading back the columns the database computes with #[Refreshes] A model marked #[Refreshes] reads back, after every write, the columns the database fills in itself: default value, generated column. Eloquent Do the exercise
  8. Symfony 8.2 New One Cache-Control for the CDN, another for the browser $response->cacheControl('CDN') writes a CDN-Cache-Control header: the CDN, which you can purge, keeps the page for a long time; the browser doesn't. HttpFoundationHTTP cache Do the exercise
  9. Laravel 13.32 New Moving a file from one disk to another with moveToDisk() copyToDisk() and moveToDisk() stream a file from one disk to another, without loading it into memory. Storage Do the exercise
  10. Symfony 8.2 New A reset link that only works once UriSigner::sign() accepts a “version”: sign the link with the password hash, and it dies as soon as the password changes. HttpFoundationSecurity Do the exercise
  11. Symfony 8.2 New Listeners that position themselves relative to each other #[AsEventListener(after: …, before: …)]: the order of listeners is stated by their names, no longer by guessed priorities. EventDispatcher Do the exercise
  12. Symfony 8.2 New Roles by family, with wildcards ROLE_BLOG_*: a single role_hierarchy key covers a whole family of roles, including those declared nowhere. SecurityRoles Do the exercise
  13. Laravel 13.26 New Handling only the last event of a burst with #[DebounceFor] A queued listener with #[DebounceFor] waits for the burst to end and handles only the last event, where ShouldBeUnique kept the first one. QueuesEvents Do the exercise
  14. Laravel 13.26 New Migrating files as they are read with read-through A read-through disk reads the new storage, falls back to the old one and copies over what it finds there: the migration happens by itself. Storage Do the exercise
  15. Laravel 13.31 New Checking that an email is sent only once assertSentOnce() and assertSentOnDemandOnce(): the Mail and Notification fakes finally say “exactly once” in one word. TestingMailNotifications Do the exercise
  16. Symfony 8.2 New One field for a date range, with BoundsType Two dates and the rule that orders them fit in a single field: no more POST_SUBMIT listener comparing the bounds by hand. Forms Do the exercise
  17. Laravel 13.24 New Restricting an array's keys with array_keys A validation rule for “this array only contains these keys”: no more closure comparing array_keys() to a list. Validation Do the exercise
  18. Symfony 8.2 New Readable subscribers: method and priority ['trace', 100] becomes ['method' => 'trace', 'priority' => 100]: getSubscribedEvents() finally says what each slot holds. EventDispatcher Do the exercise
  19. Symfony 8.2 New Describing a form with attributes A form's fields are declared on the DTO, right next to the validation constraints: no more form class for simple cases. FormsDTO Do the exercise
  20. Symfony 8.2 New Let a ValidationFailedException bubble up An uncaught ValidationFailedException now gives a 422 with the list of violations: no more need to wrap it. ValidatorAPI Do the exercise