for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Laravel Auditing package.
*
* @author Antério Vieira <[email protected]>
* @author Quetzy Garcia <[email protected]>
* @author Raphael França <[email protected]>
* @copyright 2015-2018
* For the full copyright and license information,
* please view the LICENSE.md file that was distributed
* with this source code.
*/
namespace OwenIt\Auditing\Resolvers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config;
class UserResolver implements \OwenIt\Auditing\Contracts\UserResolver
{
* {@inheritdoc}
public static function resolve()
$guards = Config::get('audit.guards', ['web']);
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return Auth::guard($guard)->user();
}
if (Auth::check()) {
return Auth::user();