TFA라는 인터페이스와 GoogleTFA라는 구현이 있습니다. 이건 내 방법입니다사용자 모델에서 바인드가 작동하지 않습니다.
Type error: Argument 1 passed to App\Models\User::toggleTFA() must implement interface App\Contracts\TFA, none given
:하지만 내 사용자 모델에 TFA를 사용하려고 때마다 나는이 오류 얻을
public function toggleTFA(TFA $tfa)
{
/**
* If we're disabling TFA then we reset his secret key.
*/
if ($this->tfa === true)
$this->tfa_secret_key = $tfa->getSecretKey();
$this->tfa = !$this->tfa;
$this->save();
}
을하고이 AppServiceProvider.php 내 바인드입니다 :
public function register()
{
/**
* GoogleTFA as default TFA adapter.
*/
$this->app->bind('App\Contracts\TFA', 'App\Models\GoogleTFA');
}
왜 이런 동작이 발생하는지 알고 싶습니다. TFA $ tfa 힌트를 내 컨트롤러의 모든 메서드에 입력하면 작동하지만 모델에 논리를 유지하려고합니다. 미리 감사드립니다.
** 전화하는 방법과 같은 정보를 제공해주십시오 ** toggleTFA ** – Haridarshan