Skip to content

Commit bb8f3fd

Browse files
committed
make username field flexible
1 parent 4c553e9 commit bb8f3fd

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
@@ -181,7 +181,7 @@ function showResponse(responseText, statusText, xhr, $form) {
181181
182182
function clickRoot() {
183183
$('.folder-item').removeClass('fa-folder-open').addClass('fa-folder');
184-
$("#working_dir").val('{{Auth::user()->name}}');
184+
$("#working_dir").val("{{config('lfm.user_field')}}");
185185
loadImages();
186186
}
187187
@@ -197,7 +197,7 @@ function clickFolder(x, y) {
197197
$('#' + x + ' > i').addClass('fa-folder');
198198
}
199199
}
200-
$("#working_dir").val('{{Auth::user()->name}}' + '\\/' + $('#' + x).data('id'));
200+
$("#working_dir").val("{{config('lfm.user_field')}}" + '\\/' + $('#' + x).data('id'));
201201
loadImages();
202202
}
203203
@@ -263,7 +263,7 @@ function trash(x) {
263263
if (data != "OK") {
264264
notify(data);
265265
} else {
266-
if ($("#working_dir").val() == "{{Auth::user()->name}}") {
266+
if ($("#working_dir").val() == "{{config('lfm.user_field')}}") {
267267
loadFiles();
268268
}
269269
loadImages();

0 commit comments

Comments
 (0)