Question from the Laravel test

Access the config file in Laravel

Hard

How to access this config in Laravel ?

< ?php
// config/app.php

return [
	‘name’ => ‘My project name’
];
Author: DamienStatus: Published(Update proposal available)Question passed 204 times
Edit
0
Community Evaluations
developer avatar
Incorrect answer
Grégory
26/04/2024
La réponse `config()->get('app.name')` est correcte (mais marquée comme incorrecte) : ```text Psy Shell v0.12.3 (PHP 8.3.2-1+ubuntu22.04.1+deb.sury.org+1 — cli) by Justin Hileman > config()->get('app.name') = "Laravel" ``` La fonction `config` appelée sans argument renvoi l'instance de la configuration, exposant une méthode `get`