This configuration setting is easy to get with the following snippet.

\Drupal::config('system.site')->get('name');

 


Saved you some valuable time?

Donate and get more free time-saving code on this website in the future.