1 | <?php namespace Arcanedev\LaravelTracker\Detectors; |
||
13 | class DeviceDetector implements DeviceDetectorContract |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Properties |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** @var \Arcanedev\Agent\Contracts\Agent */ |
||
20 | protected $agent; |
||
21 | |||
22 | /* ------------------------------------------------------------------------------------------------ |
||
23 | | Constructor |
||
24 | | ------------------------------------------------------------------------------------------------ |
||
25 | */ |
||
26 | /** |
||
27 | * DeviceDetector constructor. |
||
28 | * |
||
29 | * @param \Arcanedev\Agent\Contracts\Agent $agent |
||
30 | */ |
||
31 | 9 | public function __construct(Agent $agent) |
|
35 | |||
36 | /* ------------------------------------------------------------------------------------------------ |
||
37 | | Main Functions |
||
38 | | ------------------------------------------------------------------------------------------------ |
||
39 | */ |
||
40 | /** |
||
41 | * Detect kind, model and mobility. |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 9 | public function detect() |
|
52 | |||
53 | /** |
||
54 | * Get the kind of device. |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 9 | public function getDeviceKind() |
|
66 | |||
67 | /** |
||
68 | * Is this a tablet? |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | 9 | public function isTablet() |
|
76 | |||
77 | /** |
||
78 | * Is this a computer? |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | 9 | public function isComputer() |
|
86 | |||
87 | /** |
||
88 | * Is this a phone? |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | 9 | public function isPhone() |
|
96 | } |
||
97 |