lms/vendor/inertiajs/inertia-laravel/src/Ssr/BundleDetector.php
2025-12-15 12:26:23 +01:00

24 lines
503 B
PHP

<?php
namespace Inertia\Ssr;
class BundleDetector
{
/**
* Detect and return the path to the SSR bundle file.
*
* @return string|null
*/
public function detect()
{
return collect([
config('inertia.ssr.bundle'),
base_path('bootstrap/ssr/ssr.mjs'),
base_path('bootstrap/ssr/ssr.js'),
public_path('js/ssr.js'),
])->filter()->first(function ($path) {
return file_exists($path);
});
}
}