Skip to content

Commit

Permalink
fix cannot use closure in config/lfm.php
Browse files Browse the repository at this point in the history
  • Loading branch information
streamtw committed Jun 9, 2017
1 parent 693db23 commit e6a0d5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/traits/LfmHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,11 @@ public function sortFilesAndDirectories($arr_items, $sort_type)
*/
public function getUserSlug()
{
if (class_exists(config('lfm.user_field'))) {
if (is_callable(config('lfm.user_field'))) {
$slug_of_user = call_user_func(config('lfm.user_field'));
} elseif (class_exists(config('lfm.user_field'))) {
$config_handler = config('lfm.user_field');
$slug_of_user = app()->make($config_handler)->userField();
} elseif (is_callable(config('lfm.user_field'))) {
$slug_of_user = call_user_func(config('lfm.user_field'));
} else {
$old_slug_of_user = config('lfm.user_field');
$slug_of_user = empty(auth()->user()) ? '' : auth()->user()->$old_slug_of_user;
Expand Down

0 comments on commit e6a0d5f

Please sign in to comment.