public function __construct(AuthManager $auth, Repository $config) { $this->auth = $auth; $this->properties = collect(); $authDriver = $config['laravel-activitylog']['default_auth_driver'] ?? $auth->getDefaultDriver(); if (starts_with(app()->version(), '5.1')) { $this->causedBy = $auth->driver($authDriver)->user(); } else { $this->causedBy = $auth->guard($authDriver)->user(); } $this->logName = $config['laravel-activitylog']['default_log_name']; $this->logEnabled = $config['laravel-activitylog']['enabled'] ?? true; }
/** * Get a driver instance. * * @param string $driver * @return mixed * @static */ public static function driver($driver = null) { //Method inherited from \Illuminate\Support\Manager return \Illuminate\Auth\AuthManager::driver($driver); }
public function __construct(AuthManager $auth, UserInterface $user) { $this->auth = $auth->driver(); $this->user = $user; }
/** * @param \Illuminate\Auth\AuthManager $auth */ public function __construct(AuthManager $auth) { // Get the driver behind the AuthManager (i.e. the Guard instance) $this->auth = $auth->driver(); }