Commit 6e800ac3 authored by Sean O'Donnell's avatar Sean O'Donnell

API route fixes

parent 61de0617
......@@ -279,7 +279,7 @@ class APIController extends Controller
}
public function latestStatistics(Request $r){
$user = User::where('apikey', $r->input('apikey'))->firstOrFail();
$user = User::where('apikey', $r->input('apikey'))->first();
$follower = $user->userFollows()->first();
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.twitch.tv/helix/users?id=' . $follower->from_id,
......
......@@ -50,14 +50,11 @@ use Carbon\Carbon;
*/
Route::get('user/spotify/{name}', 'API\APIController@apispotifyCurrentSong');
/**
* Return all the users data.
*/
Route::get('user/{apikey}', 'User\APIController@getUser');
Route::get('user/latestfollower/{username}', 'API\APIController@latestFollower');
Route::get('user/statistics', 'API\APIController@latestStatistics');
Route::get('user/{apikey}', 'User\APIController@getUser');
/**
* Process any incoming processes data we get from the app
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment