Use built in method to render a string with Blade (#13688)

This commit is contained in:
Jellyfrog
2022-01-26 14:10:06 +01:00
committed by GitHub
parent 7734113594
commit 1debe5e166
7 changed files with 13 additions and 82 deletions

View File

@@ -10,6 +10,7 @@ use Gate;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;
use LibreNMS\Config;
use LibreNMS\Util\Debug;
use LibreNMS\Util\Graph;
@@ -166,7 +167,7 @@ class DeviceController extends Controller
foreach (array_values(Arr::wrap(Config::get('html.device.links'))) as $index => $link) {
$device_links['custom' . ($index + 1)] = [
'icon' => $link['icon'] ?? 'fa-external-link',
'url' => view(['template' => $link['url']], ['device' => $device])->__toString(),
'url' => Blade::render($link['url'], ['device' => $device]),
'title' => $link['title'],
'external' => $link['external'] ?? true,
];