Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Awareness

Security covered Under active development 19 sites

This module enhances developer experience by providing traits for commonly used Drupal services. It allows you to easily inject and access services within your custom classes, simplifying development. The module also includes a Drush command to generate awareness traits for your own custom services.

Provides traits and improve DX for commonly-used services.

See the code to see which services are supported.

Example: Add the entity type manager to a service


namespace Drupal\my_module;

use Drupal\awareness\Entity\EntityTypeManagerAwareTrait

/**
 * My service.
 */
class MyService {

  use EntityTypeManagerAwareTrait;

  // Custom code can call $this->getEntityTypeManager() to utilize the service.

}

Creating awareness for custom services

This module provides a Drush code generator to create awareness traits. If your module provides service, run the following to create traits for your services:

drush gen awareness:trait

Creating awareness for core services

A good bit of the commonly-used core services are provided by the traits included in this module. If you come across a core service that is not supported, please open an issue and/or a merge request to add a trait for the service.

Creating awareness for contrib services

This module is not intending to provide awareness for services from other contrib modules--that's their job. If there is a very widely used module that won't provide awareness of its services, we can discuss adding a submodule to this project to provide awareness.

Drupal 10–11

Ask your assistant about Awareness

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • file Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
16
Tracked since
Feb 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.8 Stable 10–11 Jul 24, 2025
2.0.7 Stable 9–10 Oct 18, 2024
2.0.6 Stable 9–10 Jul 13, 2024
2.0.5 Stable 9–10 Jun 28, 2024
2.0.4 Stable 9–10 May 29, 2024
2.0.3 Stable 9–10 May 29, 2024
2.0.2 Stable 9–10 May 28, 2024
2.0.1 Stable 9–10 May 17, 2024
2.0.0 Stable 9–10 May 17, 2024
2.0.0-alpha4 Pre-release 9–10 Nov 2, 2023