Setting entity form widgets and view display formatters

When building a custom entity programmatically, you'll find yourself wondering which type of display options to use for your fields. The full list can be easily retrieved with these small helpers snippets.

Programmatically make a recurring payment

How to programmatically create a recurring payment with Drupal commerce recurring module.

Display explanation or submission guidelines on a custom route

Drupal allows configuring explanation and submission guidelines for each content type. How to display those on a custom route ?

Using "new" indicator in a custom controller

Drupal core provides out of the box a "new" indicator to tell users when there is a new content for them, such as nodes or comments. How to implement this in a custom controller ?

Using username than user id in user paths

Drupal by default uses user UIDs in its path to retrieve a user object. How to pass the username in URLs and retrieve the user object from the route match interface.

Renaming files with a random name.

How to rename uploaded files with programmatically generated random names on Drupal 8/9.

Create a dynamic menu link

How to programmatically create a dynamic menu link (and pass it an argument).

Using Rules with Commerce Funds

Combine the power of Rules with Commerce Funds. Make custom forms and trigger transactions with Rules.

Food delivery platform with Drupal

Building a food delivery platform with Drupal Commerce and Commerce Funds.

How to join user table with another table in views data

How to implement custom views data on Drupal 8 and to join the user table to the query using hook_views_data(). Making a relationship between a user uid and the user table to finally get a fully loaded user object.