how can solve it
Define a const named ROOT_PATH
Or, depending on where this path is in the context of your application; maybe one of the path helper functions would be better???
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I met this problem
Use of undefined constant ROOT_PATH - assumed 'ROOT_PATH' (this will throw an Error in a future version of PHP)
how can solve it
public function themes(){
$title = __a('themes');
$current_theme = get_option('current_theme');
$installed_themes = [];
foreach (Finder::create()->in(ROOT_PATH.'/themes')->directories()->depth(0) as $dir) {
$directoryName = $dir->getBasename();
$themePath = $dir->getPathname();
$theme_info = include_once $themePath.'/ThemeInfo.php';
@kyawswar just define it in public/index.php - you will see how the LARAVEL_START is defined in there
Please or to participate in this conversation.