1 | <?php |
||
12 | class User extends Provider |
||
13 | { |
||
14 | use UploadsImages, HasProfileSettings; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $loginRequiredFor = [ |
||
20 | 'id', |
||
21 | 'invite', |
||
22 | 'profile', |
||
23 | 'username', |
||
24 | 'isBanned', |
||
25 | 'deactivate', |
||
26 | 'sessionsHistory', |
||
27 | 'convertToBusiness', |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * Updates or returns user profile info. Gets associative array as a param. Available keys of array are: |
||
32 | * 'last_name', 'first_name', 'username', 'about', 'location' and 'website_url'. |
||
33 | * You can also change user avatar by passing 'profile_image'. |
||
34 | * |
||
35 | * @param array $userInfo If empty returns current user profile. |
||
36 | * |
||
37 | * @return bool|array|Profile |
||
38 | */ |
||
39 | public function profile($userInfo = null) |
||
46 | |||
47 | /** |
||
48 | * Checks if current user is banned |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function isBanned() |
||
56 | |||
57 | /** |
||
58 | * Returns current user username |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function username() |
||
66 | |||
67 | /** |
||
68 | * Returns current user id |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | public function id() |
||
76 | |||
77 | /** |
||
78 | * Deactivates your account. |
||
79 | * |
||
80 | * @param string $reason |
||
81 | * @param string $explanation |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function deactivate($reason = 'other', $explanation = '') |
||
98 | |||
99 | /** |
||
100 | * Send invite to email |
||
101 | * @param string $email |
||
102 | * @return bool|Response |
||
103 | */ |
||
104 | public function invite($email) |
||
113 | |||
114 | /** |
||
115 | * Remove things you’ve recently searched for from search suggestions. |
||
116 | * @return bool|Response |
||
117 | */ |
||
118 | public function clearSearchHistory() |
||
122 | |||
123 | /** |
||
124 | * Simply makes GET request to some url. |
||
125 | * @param string $url |
||
126 | * @return array|bool |
||
127 | */ |
||
128 | public function visitPage($url = '') |
||
132 | |||
133 | /** |
||
134 | * Get your account sessions history |
||
135 | * @return array |
||
136 | */ |
||
137 | public function sessionsHistory() |
||
141 | |||
142 | /** |
||
143 | * @return array |
||
144 | */ |
||
145 | protected function getProfile() |
||
149 | |||
150 | /** |
||
151 | * @param array|Profile $userInfo |
||
152 | * @return bool|Response |
||
153 | */ |
||
154 | protected function updateProfile($userInfo) |
||
167 | |||
168 | /** |
||
169 | * @param string $key |
||
170 | * @return mixed|string |
||
171 | */ |
||
172 | protected function getProfileData($key) |
||
178 | } |
||
179 |