Enable disabling internal templates, as well as having custom templates

This commit is contained in:
Deon George 2025-06-21 09:51:03 +10:00
parent e8aaa17122
commit f6b7bff605
2 changed files with 5 additions and 1 deletions

View File

@ -53,7 +53,10 @@ class Entry extends Model
$template_dir = Storage::disk(config('pla.template.dir'));
$templates = collect();
foreach (array_filter($template_dir->files(),fn($item)=>Str::endsWith($item,'.json')) as $file) {
foreach (array_filter($template_dir->files('.',TRUE),fn($item)=>Str::endsWith($item,'.json')) as $file) {
if (config('pla.template.exclude_system',FALSE) && Str::doesntContain($file,'/'))
continue;
$to = new Template($file);
if ($to->invalid) {

View File

@ -94,5 +94,6 @@ return [
'template' => [
'dir' => env('LDAP_TEMPLATE_DRIVER','templates'),
'exclude_system' => env('LDAP_TEMPLATE_EXCLUDE_SYSTEM',FALSE),
],
];