1 | <?php namespace Arcanedev\NoCaptcha; |
||
12 | * @package Arcanedev\NoCaptcha |
||
13 | * @author ARCANEDEV <[email protected]> |
||
14 | */ |
||
15 | class NoCaptchaManager extends Manager implements NoCaptchaManagerContract |
||
16 | { |
||
17 | /* ----------------------------------------------------------------- |
||
18 | | Getters |
||
19 | | ----------------------------------------------------------------- |
||
20 | */ |
||
21 | |||
22 | /** |
||
23 | * Get the default driver name. |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | 2 | public function getDefaultDriver(): string |
|
28 | { |
||
29 | 2 | return $this->config('version'); |
|
30 | } |
||
31 | |||
32 | /* ----------------------------------------------------------------- |
||
33 | | Main Methods |
||
34 | | ----------------------------------------------------------------- |
||
35 | */ |
||
36 | |||
37 | /** |
||
38 | * Get the NoCaptcha driver by the given version. |
||
39 | * |
||
40 | * @param string|null $version |
||
41 | * |
||
42 | * @return \Arcanedev\NoCaptcha\NoCaptchaV3|\Arcanedev\NoCaptcha\NoCaptchaV2 |
||
43 | */ |
||
44 | 16 | public function version($version = null): NoCaptchaContract |
|
45 | { |
||
46 | 16 | return $this->driver($version); |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * Create the v2 captcha. |
||
51 | * |
||
52 | * @return \Arcanedev\NoCaptcha\NoCaptchaV2 |
||
53 | */ |
||
54 | 2 | public function createV2Driver(): NoCaptchaContract |
|
55 | { |
||
56 | 2 | return $this->buildDriver(NoCaptchaV2::class); |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * Create the v3 captcha. |
||
61 | * |
||
62 | * @return \Arcanedev\NoCaptcha\NoCaptchaV3 |
||
63 | */ |
||
64 | 14 | public function createV3Driver(): NoCaptchaContract |
|
65 | { |
||
66 | 14 | return $this->buildDriver(NoCaptchaV3::class); |
|
67 | } |
||
68 | |||
69 | /* ----------------------------------------------------------------- |
||
70 | | Other Methods |
||
102 |