1 | <?php |
||
11 | class User extends Provider |
||
12 | { |
||
13 | use UploadsImages; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $loginRequiredFor = [ |
||
19 | 'invite', |
||
20 | 'profile', |
||
21 | 'username', |
||
22 | 'isBanned', |
||
23 | 'deactivate', |
||
24 | 'convertToBusiness', |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * Updates or returns user profile info. Gets associative array as a param. Available keys of array are: |
||
29 | * 'last_name', 'first_name', 'username', 'about', 'location' and 'website_url'. |
||
30 | * You can also change user avatar by passing 'profile_image'. |
||
31 | * |
||
32 | * @param array $userInfo If empty returns current user profile. |
||
33 | * |
||
34 | * @return bool|array|Profile |
||
35 | */ |
||
36 | public function profile($userInfo = null) |
||
43 | |||
44 | /** |
||
45 | * Checks if current user is banned |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function isBanned() |
||
57 | |||
58 | /** |
||
59 | * Returns current user username |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | public function username() |
||
69 | |||
70 | /** |
||
71 | * Deactivates your account. |
||
72 | * |
||
73 | * @param string $reason |
||
74 | * @param string $explanation |
||
75 | * @return bool |
||
76 | */ |
||
77 | public function deactivate($reason = 'other', $explanation = '') |
||
91 | |||
92 | /** |
||
93 | * Send invite to email |
||
94 | * @param string $email |
||
95 | * @return bool|Response |
||
96 | */ |
||
97 | public function invite($email) |
||
106 | |||
107 | /** |
||
108 | * Remove things you’ve recently searched for from search suggestions. |
||
109 | * @return bool|Response |
||
110 | */ |
||
111 | public function clearSearchHistory() |
||
115 | |||
116 | /** |
||
117 | * @return array|bool|Response |
||
118 | */ |
||
119 | protected function getProfile() |
||
123 | |||
124 | /** |
||
125 | * @param array|Profile $userInfo |
||
126 | * @return bool|Response |
||
127 | */ |
||
128 | protected function updateProfile($userInfo) |
||
141 | } |
||
142 |