Quick route fix

This commit is contained in:
An Phan 2016-01-26 23:23:55 +08:00
parent 8453c8e30b
commit 57b6cc022e
2 changed files with 6 additions and 2 deletions

View file

@ -82,10 +82,14 @@ class LastfmController extends Controller
/**
* Set the Last.fm session key of the current user.
*
* @param Request $request
*
* @return \Illuminate\Http\JsonResponse
*/
public function setSessionKey(Request $request)
{
$this->auth->user()->savePreference('lastfm_session_key', $request->input('key'));
$this->auth->user()->savePreference('lastfm_session_key', trim($request->input('key')));
return response()->json();
}

View file

@ -22,7 +22,7 @@ Route::group(['prefix' => 'api', 'namespace' => 'API'], function () {
Route::post('settings', 'SettingController@save');
Route::get('play/{song}', 'SongController@play');
Route::get('{song}/play', 'SongController@play');
Route::post('{song}/scrobble/{timestamp}', 'SongController@scrobble')->where([
'timestamp' => '\d+',
]);