Skip to content

Commit 503c545

Browse files
authored
Merge pull request #460 from JavierPDev/enhancement/configurable-assets-location
Made the assets path configurable
2 parents 9e46dd5 + 3556ee9 commit 503c545

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

config/log-viewer.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@
4141

4242
'route_path' => 'log-viewer',
4343

44+
/*
45+
|--------------------------------------------------------------------------
46+
| Log Viewer Assets Path
47+
|--------------------------------------------------------------------------
48+
| The path to the Log Viewer assets.
49+
|
50+
*/
51+
52+
'assets_path' => 'vendor/log-viewer',
53+
4454
/*
4555
|--------------------------------------------------------------------------
4656
| Back to system URL

resources/views/index.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
88
<meta name="csrf-token" content="{{ csrf_token() }}">
9-
<link rel="shortcut icon" href="{{ asset(mix('img/log-viewer-32.png', 'vendor/log-viewer')) }}">
9+
<link rel="shortcut icon" href="{{ asset(mix('img/log-viewer-32.png', config('log-viewer.assets_path'))) }}">
1010

1111
<title>Log Viewer{{ config('app.name') ? ' - ' . config('app.name') : '' }}</title>
1212

1313
<!-- Style sheets-->
14-
<link href="{{ asset(mix('app.css', 'vendor/log-viewer')) }}" rel="stylesheet" onerror="alert('app.css failed to load. Please refresh the page, re-publish Log Viewer assets, or fix routing for vendor assets.')">
14+
<link href="{{ asset(mix('app.css', config('log-viewer.assets_path'))) }}" rel="stylesheet" onerror="alert('app.css failed to load. Please refresh the page, re-publish Log Viewer assets, or fix routing for vendor assets.')">
1515
</head>
1616

1717
<body class="h-full px-3 lg:px-5 bg-gray-100 dark:bg-gray-900">
@@ -26,6 +26,6 @@
2626
// Add additional headers for LogViewer requests like so:
2727
// window.LogViewer.headers['Authorization'] = 'Bearer xxxxxxx';
2828
</script>
29-
<script src="{{ asset(mix('app.js', 'vendor/log-viewer')) }}" onerror="alert('app.js failed to load. Please refresh the page, re-publish Log Viewer assets, or fix routing for vendor assets.')"></script>
29+
<script src="{{ asset(mix('app.js', config('log-viewer.assets_path'))) }}" onerror="alert('app.js failed to load. Please refresh the page, re-publish Log Viewer assets, or fix routing for vendor assets.')"></script>
3030
</body>
3131
</html>

src/LogViewerServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected function registerResources()
113113
protected function defineAssetPublishing()
114114
{
115115
$this->publishes([
116-
self::basePath('/public') => public_path('vendor/log-viewer'),
116+
self::basePath('/public') => public_path(config('log-viewer.assets_path')),
117117
], 'log-viewer-assets');
118118
}
119119

0 commit comments

Comments
 (0)