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