Файл: gapps/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php
Строк: 41
<?php
namespace IlluminateFoundationTestingConcerns;
use IlluminateContractsAuthAuthenticatable as UserContract;
trait ImpersonatesUsers
{
/**
* Set the currently logged in user for the application.
*
* @param IlluminateContractsAuthAuthenticatable $user
* @param string|null $driver
* @return $this
*/
public function actingAs(UserContract $user, $driver = null)
{
$this->be($user, $driver);
return $this;
}
/**
* Set the currently logged in user for the application.
*
* @param IlluminateContractsAuthAuthenticatable $user
* @param string|null $driver
* @return void
*/
public function be(UserContract $user, $driver = null)
{
$this->app['auth']->guard($driver)->setUser($user);
}
}