@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $list = (array)SlackUser::lists(); |
32 | 32 | |
33 | 33 | if (is_null($count)) { |
34 | - return $list['members']; |
|
34 | + return $list['members']; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return array_slice($list['members'], 0, $count); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function sendMessageToTeam(Request $request) |
46 | 46 | { |
47 | - $this->validate($request, [ |
|
47 | + $this->validate($request, [ |
|
48 | 48 | 'message' => 'required' |
49 | 49 | ]); |
50 | 50 |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | */ |
29 | 29 | private function getAllUsersOnYourTeam($count = null) |
30 | 30 | { |
31 | - $list = (array)SlackUser::lists(); |
|
31 | + $list = (array) SlackUser::lists(); |
|
32 | 32 | |
33 | 33 | if (is_null($count)) { |
34 | - return $list['members']; |
|
34 | + return $list[ 'members' ]; |
|
35 | 35 | } |
36 | 36 | |
37 | - return array_slice($list['members'], 0, $count); |
|
37 | + return array_slice($list[ 'members' ], 0, $count); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | 'message' => 'required' |
49 | 49 | ]); |
50 | 50 | |
51 | - $message = $request->input('message') . ' #FromLaravelHackathonStarter :smile:'; |
|
51 | + $message = $request->input('message').' #FromLaravelHackathonStarter :smile:'; |
|
52 | 52 | |
53 | 53 | SlackChat::message('#general', $message); |
54 | 54 | |
55 | - return redirect()->back()->with('info','Your Message has been sent successfully'); |
|
55 | + return redirect()->back()->with('info', 'Your Message has been sent successfully'); |
|
56 | 56 | } |
57 | 57 | } |
@@ -2,15 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | - |
|
7 | -use App\Http\Requests; |
|
8 | 5 | use App\Http\Controllers\Controller; |
9 | 6 | use Facebook; |
10 | -use App\User; |
|
11 | 7 | use Auth; |
12 | 8 | use Session; |
13 | -use Illuminate\Support\Collection; |
|
14 | 9 | |
15 | 10 | class FacebookController extends Controller |
16 | 11 | { |
@@ -41,8 +41,8 @@ |
||
41 | 41 | */ |
42 | 42 | private function getData() |
43 | 43 | { |
44 | - $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken()); |
|
44 | + $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken()); |
|
45 | 45 | |
46 | - return json_decode($data->getGraphUser(),true); |
|
46 | + return json_decode($data->getGraphUser(),true); |
|
47 | 47 | } |
48 | 48 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getPage() |
24 | 24 | { |
25 | - if( Session::get('provider') !== 'facebook') { |
|
25 | + if (Session::get('provider') !== 'facebook') { |
|
26 | 26 | Auth::logout(); |
27 | 27 | |
28 | 28 | Session::flush(); |
@@ -43,6 +43,6 @@ discard block |
||
43 | 43 | { |
44 | 44 | $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken()); |
45 | 45 | |
46 | - return json_decode($data->getGraphUser(),true); |
|
46 | + return json_decode($data->getGraphUser(), true); |
|
47 | 47 | } |
48 | 48 | } |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | |
14 | 14 | class LinkedInController extends Controller |
15 | 15 | { |
16 | - /** |
|
17 | - * LinkedIn API base Url |
|
18 | - * @var string |
|
19 | - */ |
|
16 | + /** |
|
17 | + * LinkedIn API base Url |
|
18 | + * @var string |
|
19 | + */ |
|
20 | 20 | protected $baseUrl; |
21 | 21 | |
22 | 22 | /** |
@@ -31,19 +31,19 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected $response; |
33 | 33 | |
34 | - /** |
|
35 | - * Initialize the Controller with necessary arguments |
|
36 | - */ |
|
34 | + /** |
|
35 | + * Initialize the Controller with necessary arguments |
|
36 | + */ |
|
37 | 37 | public function __construct() |
38 | 38 | { |
39 | 39 | $this->baseUrl = 'https://api.linkedin.com/v1'; |
40 | 40 | $this->client = new Client(['base_uri' => $this->baseUrl]); |
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
44 | - * Set options for making the Client request |
|
45 | - * @return void |
|
46 | - */ |
|
43 | + /** |
|
44 | + * Set options for making the Client request |
|
45 | + * @return void |
|
46 | + */ |
|
47 | 47 | private function setRequestOptions() |
48 | 48 | { |
49 | 49 | $authBearer = 'Bearer '. Auth::user()->getAccessToken(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct() |
38 | 38 | { |
39 | 39 | $this->baseUrl = 'https://api.linkedin.com/v1'; |
40 | - $this->client = new Client(['base_uri' => $this->baseUrl]); |
|
40 | + $this->client = new Client([ 'base_uri' => $this->baseUrl ]); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | */ |
47 | 47 | private function setRequestOptions() |
48 | 48 | { |
49 | - $authBearer = 'Bearer '. Auth::user()->getAccessToken(); |
|
50 | - $this->client = new Client(['base_uri' => $this->baseUrl, |
|
49 | + $authBearer = 'Bearer '.Auth::user()->getAccessToken(); |
|
50 | + $this->client = new Client([ 'base_uri' => $this->baseUrl, |
|
51 | 51 | 'headers' => [ |
52 | 52 | 'Authorization' => $authBearer, |
53 | 53 | 'Content-Type' => 'application/json', |
54 | 54 | 'Accept' => 'application/json' |
55 | - ]]); |
|
55 | + ] ]); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | private function setGetResponse($relativeUrl) |
63 | 63 | { |
64 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
64 | + $this->response = $this->client->get($this->baseUrl.$relativeUrl, [ ]); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -16,9 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | protected $foursquare; |
18 | 18 | |
19 | - /** |
|
20 | - * Initialize the Controller with necessary arguments |
|
21 | - */ |
|
19 | + /** |
|
20 | + * Initialize the Controller with necessary arguments |
|
21 | + */ |
|
22 | 22 | public function __construct() |
23 | 23 | { |
24 | 24 | $this->foursquare = new FoursquareApi(env('FOURSQUARE_CLIENT_ID'), env('FOURSQUARE_CLIENT_SECRET')); |
@@ -34,12 +34,12 @@ |
||
34 | 34 | $endpoint = 'venues/search'; |
35 | 35 | |
36 | 36 | // Prepare parameters |
37 | - $params = ['near' => 'Lagos, Nigeria']; |
|
37 | + $params = [ 'near' => 'Lagos, Nigeria' ]; |
|
38 | 38 | |
39 | 39 | // Perform a request to a public resource |
40 | - $response = json_decode($this->foursquare->GetPublic($endpoint,$params),true); |
|
40 | + $response = json_decode($this->foursquare->GetPublic($endpoint, $params), true); |
|
41 | 41 | |
42 | - return $response['response']['venues']; |
|
42 | + return $response[ 'response' ][ 'venues' ]; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -16,9 +16,9 @@ |
||
16 | 16 | */ |
17 | 17 | protected $foursquare; |
18 | 18 | |
19 | - /** |
|
20 | - * Initialize the Controller with necessary arguments |
|
21 | - */ |
|
19 | + /** |
|
20 | + * Initialize the Controller with necessary arguments |
|
21 | + */ |
|
22 | 22 | public function __construct() |
23 | 23 | { |
24 | 24 | $this->foursquare = new FoursquareApi(env('FOURSQUARE_CLIENT_ID'), env('FOURSQUARE_CLIENT_SECRET')); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $info = $this->tumblr->blogInfo($tumblrBlogUrl); |
37 | 37 | |
38 | - return (array)$info; |
|
38 | + return (array) $info; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $info = $this->tumblr->posts($tumblrBlogUrl); |
48 | 48 | |
49 | - return (array)$info->response->posts; |
|
49 | + return (array) $info->response->posts; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -2,5 +2,5 @@ |
||
2 | 2 | |
3 | 3 | function load_asset($asset_url) |
4 | 4 | { |
5 | - return ( env('APP_ENV') === 'production' ) ? secure_asset($asset_url) : asset($asset_url); |
|
5 | + return (env('APP_ENV') === 'production') ? secure_asset($asset_url) : asset($asset_url); |
|
6 | 6 | } |
@@ -23,27 +23,27 @@ discard block |
||
23 | 23 | | |
24 | 24 | */ |
25 | 25 | |
26 | -Route::group(['middleware' => ['web']], function () { |
|
26 | +Route::group([ 'middleware' => [ 'web' ] ], function() { |
|
27 | 27 | |
28 | - Route::get('/', function () { |
|
28 | + Route::get('/', function() { |
|
29 | 29 | return view('welcome'); |
30 | 30 | }); |
31 | 31 | |
32 | - Route::get('/api', function () { |
|
32 | + Route::get('/api', function() { |
|
33 | 33 | return view('apidashboard'); |
34 | 34 | }); |
35 | 35 | |
36 | - Route::group(['prefix' => 'api'], function() { |
|
36 | + Route::group([ 'prefix' => 'api' ], function() { |
|
37 | 37 | Route::get('github', [ |
38 | 38 | 'uses' => 'GithubController@getPage', |
39 | 39 | 'as' => 'api.github', |
40 | - 'middleware' => ['auth'] |
|
40 | + 'middleware' => [ 'auth' ] |
|
41 | 41 | ]); |
42 | 42 | |
43 | 43 | Route::get('twitter', [ |
44 | 44 | 'uses' => 'TwitterController@getPage', |
45 | 45 | 'as' => 'api.twitter', |
46 | - 'middleware' => ['auth'] |
|
46 | + 'middleware' => [ 'auth' ] |
|
47 | 47 | ]); |
48 | 48 | |
49 | 49 | Route::get('lastfm', [ |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | Route::get('facebook', [ |
118 | 118 | 'uses' => 'FacebookController@getPage', |
119 | 119 | 'as' => 'api.facebook', |
120 | - 'middleware' => ['auth'] |
|
120 | + 'middleware' => [ 'auth' ] |
|
121 | 121 | ]); |
122 | 122 | |
123 | 123 | Route::get('linkedin', [ |
124 | 124 | 'uses' => 'LinkedInController@getPage', |
125 | 125 | 'as' => 'api.linkedin', |
126 | - 'middleware' => ['auth'] |
|
126 | + 'middleware' => [ 'auth' ] |
|
127 | 127 | ]); |
128 | 128 | |
129 | 129 | Route::get('foursquare', [ |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | Route::get('instagram', [ |
135 | 135 | 'uses' => 'InstagramController@getPage', |
136 | 136 | 'as' => 'api.instagram', |
137 | - 'middleware' => ['auth'] |
|
137 | + 'middleware' => [ 'auth' ] |
|
138 | 138 | ]); |
139 | 139 | |
140 | 140 | Route::get('tumblr', [ |
@@ -151,18 +151,18 @@ discard block |
||
151 | 151 | Route::post('/tweet/new', [ |
152 | 152 | 'uses' => 'TwitterController@sendTweet', |
153 | 153 | 'as' => 'tweet.new', |
154 | - 'middleware' => ['auth'] |
|
154 | + 'middleware' => [ 'auth' ] |
|
155 | 155 | ]); |
156 | 156 | |
157 | 157 | Route::get('/login', [ |
158 | 158 | 'uses' => 'Auth\AuthController@getLogin', |
159 | 159 | 'as' => 'auth.login', |
160 | - 'middleware' => ['guest'] |
|
160 | + 'middleware' => [ 'guest' ] |
|
161 | 161 | ]); |
162 | 162 | |
163 | 163 | Route::post('/login', [ |
164 | 164 | 'uses' => 'Auth\AuthController@postLogin', |
165 | - 'middleware' => ['guest'] |
|
165 | + 'middleware' => [ 'guest' ] |
|
166 | 166 | ]); |
167 | 167 | |
168 | 168 | // Password Reset Routes... |
@@ -176,50 +176,50 @@ discard block |
||
176 | 176 | Route::get('/account', [ |
177 | 177 | 'uses' => 'AccountController@getAccountPage', |
178 | 178 | 'as' => 'account.dashboard', |
179 | - 'middleware' => ['auth'] |
|
179 | + 'middleware' => [ 'auth' ] |
|
180 | 180 | ]); |
181 | 181 | |
182 | 182 | Route::post('/account/profile', [ |
183 | 183 | 'uses' => 'AccountController@updateProfile', |
184 | 184 | 'as' => 'account.profile', |
185 | - 'middleware' => ['auth'] |
|
185 | + 'middleware' => [ 'auth' ] |
|
186 | 186 | ]); |
187 | 187 | |
188 | 188 | Route::post('/account/photo', [ |
189 | 189 | 'uses' => 'AccountController@updateAvatar', |
190 | 190 | 'as' => 'account.avatar', |
191 | - 'middleware' => ['auth'] |
|
191 | + 'middleware' => [ 'auth' ] |
|
192 | 192 | ]); |
193 | 193 | |
194 | 194 | Route::post('/account/password', [ |
195 | 195 | 'uses' => 'AccountController@changePassword', |
196 | 196 | 'as' => 'account.password', |
197 | - 'middleware' => ['auth'] |
|
197 | + 'middleware' => [ 'auth' ] |
|
198 | 198 | ]); |
199 | 199 | |
200 | 200 | Route::post('/account/delete/now', [ |
201 | 201 | 'uses' => 'AccountController@deleteAccount', |
202 | 202 | 'as' => 'account.delete.now', |
203 | - 'middleware' => ['auth'] |
|
203 | + 'middleware' => [ 'auth' ] |
|
204 | 204 | ]); |
205 | 205 | |
206 | 206 | |
207 | 207 | Route::get('/account/confirm/delete', [ |
208 | 208 | 'uses' => 'AccountController@redirectToConfirmDeletePage', |
209 | 209 | 'as' => 'account.confirm.delete', |
210 | - 'middleware' => ['auth'] |
|
210 | + 'middleware' => [ 'auth' ] |
|
211 | 211 | ]); |
212 | 212 | |
213 | 213 | Route::get('/account/delete/later', [ |
214 | 214 | 'uses' => 'AccountController@dontDeleteAccount', |
215 | 215 | 'as' => 'account.dont.delete', |
216 | - 'middleware' => ['auth'] |
|
216 | + 'middleware' => [ 'auth' ] |
|
217 | 217 | ]); |
218 | 218 | |
219 | 219 | Route::get('/signup', [ |
220 | 220 | 'uses' => 'Auth\AuthController@getRegister', |
221 | 221 | 'as' => 'auth.register', |
222 | - 'middleware' => ['guest'] |
|
222 | + 'middleware' => [ 'guest' ] |
|
223 | 223 | ]); |
224 | 224 | |
225 | 225 | Route::get('logout', [ |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | |
230 | 230 | Route::post('/signup', [ |
231 | 231 | 'uses' => 'Auth\AuthController@postRegister', |
232 | - 'middleware' => ['guest'] |
|
232 | + 'middleware' => [ 'guest' ] |
|
233 | 233 | ]); |
234 | 234 | |
235 | - Route::get('/contact', function () { |
|
235 | + Route::get('/contact', function() { |
|
236 | 236 | return view('contact'); |
237 | 237 | }); |
238 | 238 |
@@ -38,8 +38,8 @@ |
||
38 | 38 | $tracks = array_slice($this->getTopTracks(), 0, 10); |
39 | 39 | |
40 | 40 | return view('api.lastfm')->withDetails($details) |
41 | - ->withAlbums($albums) |
|
42 | - ->withTracks($tracks); |
|
41 | + ->withAlbums($albums) |
|
42 | + ->withTracks($tracks); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | */ |
49 | 49 | private function getArtistInfo() |
50 | 50 | { |
51 | - $result = (array)$this->lastfm->artist_getInfo(['artist' => 'The Pierces']); |
|
51 | + $result = (array) $this->lastfm->artist_getInfo([ 'artist' => 'The Pierces' ]); |
|
52 | 52 | |
53 | - return $result['artist']; |
|
53 | + return $result[ 'artist' ]; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | */ |
60 | 60 | private function getTopAlbums() |
61 | 61 | { |
62 | - $result = (array)$this->lastfm->artist_getTopAlbums(['artist' => 'The Pierces']); |
|
62 | + $result = (array) $this->lastfm->artist_getTopAlbums([ 'artist' => 'The Pierces' ]); |
|
63 | 63 | |
64 | - return $result['topalbums']->album; |
|
64 | + return $result[ 'topalbums' ]->album; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | */ |
71 | 71 | private function getTopTracks() |
72 | 72 | { |
73 | - $result = (array)$this->lastfm->artist_getTopTracks(['artist' => 'The Pierces']); |
|
73 | + $result = (array) $this->lastfm->artist_getTopTracks([ 'artist' => 'The Pierces' ]); |
|
74 | 74 | |
75 | - return $result['toptracks']->track; |
|
75 | + return $result[ 'toptracks' ]->track; |
|
76 | 76 | } |
77 | 77 | } |
@@ -27,8 +27,8 @@ |
||
27 | 27 | |
28 | 28 | public function getAvatarUrl() |
29 | 29 | { |
30 | - if(is_null($this->avatar)) { |
|
31 | - return "http://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))) . "?d=mm&s=40"; |
|
30 | + if (is_null($this->avatar)) { |
|
31 | + return "http://www.gravatar.com/avatar/".md5(strtolower(trim($this->email)))."?d=mm&s=40"; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | return $this->avatar; |