Skip to content

Commit 247dec7

Browse files
committed
make user field flexible
1 parent 420df18 commit 247dec7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/config/lfm.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
'allow_multi_user' => true,
1313

14+
'user_field' => "\Auth::user()->name",
15+
1416
'middlewares' => ['auth', '\Tsawler\Laravelfilemanager\middleware\MultiUser'],
1517

1618
'file_type_array' => [

src/views/index.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function showResponse(responseText, statusText, xhr, $form) {
180180
181181
function clickRoot() {
182182
$('.folder-item').removeClass('fa-folder-open').addClass('fa-folder');
183-
$("#working_dir").val('{{Auth::user()->name}}');
183+
$("#working_dir").val("{{config('lfm.user_field')}}");
184184
loadImages();
185185
}
186186
@@ -196,7 +196,7 @@ function clickFolder(x, y) {
196196
$('#' + x + ' > i').addClass('fa-folder');
197197
}
198198
}
199-
$("#working_dir").val('{{Auth::user()->name}}' + '\\/' + $('#' + x).data('id'));
199+
$("#working_dir").val("{{config('lfm.user_field')}}" + '\\/' + $('#' + x).data('id'));
200200
loadImages();
201201
}
202202
@@ -262,7 +262,7 @@ function trash(x) {
262262
if (data != "OK") {
263263
notify(data);
264264
} else {
265-
if ($("#working_dir").val() == "{{Auth::user()->name}}") {
265+
if ($("#working_dir").val() == "{{config('lfm.user_field')}}") {
266266
loadFiles();
267267
}
268268
loadImages();

0 commit comments

Comments
 (0)