The app_path function returns the fully qualified path to your application's app directory. You may also use the app_path function to generate a fully qualified path to a file relative to the application directory:
<?php $path = app_path();

$path = app_path('Http/Controllers/Controller.php');
<?php     protected function loadModels(string $directory, array $models = []): Collection

    {

        if (!empty($models)) {

            $dir = str_replace(app_path(), '', $directory);



            return collect($models)->map(function ($name) use ($dir) {

                if (strpos($name, '\\') !== false) {
<?php             return base_path($path);

        }



        if (File::isDirectory(app_path('Models'))) {

            return app_path('Models');

        }
<?php         }



        if (File::isDirectory(app_path('Models'))) {

            return app_path('Models');

        }



        return app_path();
<?php             return app_path('Models');

        }



        return app_path();

    }

}
<?php         $this->setUpDatabase($this->app);



        $this->beforeApplicationDestroyed(function () {

            File::cleanDirectory(app_path());

            File::cleanDirectory(database_path('factories'));

        });

    }