-
Details about assets_pathIn projects where the public directory is relocated, Temporary Workaround:We’ve resolved this by extending LogViewerService and overriding assetsAreCurrent() to respect the configured path # File: App\Providers\AppServiceProvider.php
namespace App\Providers;
use Opcodes\LogViewer\LogViewerService;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
// Ensure the log viewer assets are always current
// Because the log viewer not using path from config('log-viewer.assets_path')
$this->app->extend(LogViewerService::class, function ($service, $app) {
return new class($service) extends LogViewerService {
public function assetsAreCurrent(): bool
{
$path = config('log-viewer.assets_path', 'vendor/log-viewer');
return file_exists(public_path($path . '/mix-manifest.json'));
}
};
});
}
}Suggested Fix:It would be great if assetsAreCurrent() could use the configured assets_path instead of relying on a hardcoded location. This would make the package more flexible and compatible with Laravel installations that use custom public directories or deployment setups. Environment:
Thanks for your great work on this package — it’s incredibly useful and well-designed. Let me know if you'd like help submitting a PR for this fix. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I ran into the same issue. Thank you for this code snippet to resolve it. I modified it a little bit to get rid of warning message on log viewing page about the assets not being up to date. I just returned a similar check as the original method does as it compares the 2 file contents. I am also using a rootPublicPath function I made to get the full root path to things. This is in my AppServiceProvider.php $this->app->extend(LogViewerService::class, function ($service, $app) {
return new class($service) extends LogViewerService {
public function assetsAreCurrent(): bool
{
return File::get(rootPublicPath('vendor/log-viewer/mix-manifest.json'))
=== File::get(__DIR__.'/../../vendor/opcodesio/log-viewer/public/mix-manifest.json');
}
};
});I did also have to get rid of the mix() in the blade view and simply reference the same files with just the asset(). Hopefully this can get resolved in the package :) Environment
|
Beta Was this translation helpful? Give feedback.
-
|
Hey @wnikk @fastsol , thanks for reporting this! Indeed the
|
Beta Was this translation helpful? Give feedback.
Hey @wnikk @fastsol , thanks for reporting this!
Indeed the
assetsAreCurrentbehaviour was not using the configurable asset path.