Skip to content

Commit

Permalink
Move config() call outside of config file
Browse files Browse the repository at this point in the history
  • Loading branch information
bilfeldt authored May 7, 2024
1 parent 4bcdd8a commit 2a8f1b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config/request-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
| This is the model used for user relationships.
| You can set a custom user model for relationships.
|
| Leaving this empty will use the model from the 'users' auth provider.
|
*/
'user_model' => env('REQUEST_LOGGER_USER_MODEL', config('auth.providers.users.model')),
'user_model' => env('REQUEST_LOGGER_USER_MODEL'),
];
2 changes: 1 addition & 1 deletion src/Models/RequestLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class RequestLog extends Model implements RequestLoggerInterface

public function user(): BelongsTo
{
return $this->belongsTo(config('request-logger.user_model'));
return $this->belongsTo(config('request-logger.user_model') ?? config('auth.providers.users.model'));
}

public function team(): BelongsTo
Expand Down

0 comments on commit 2a8f1b5

Please sign in to comment.