mardi 22 décembre 2015

Multiple route params, Laravel 5.1

Consider the following route:

Route::group([
    'prefix' => 'api/v1/'
], function() {
    Route::get('twitter-tweets/{name}/{amount}', 'Api\V1\Twitter\TweetsController@getTweets');
});

Then going to that route in my browser:

http://ift.tt/1QFvZSF

Gives me:

NotFoundHttpException in RouteCollection.php

Um ???

the controller looks like:

<?php

namespace App\Http\Controllers\Api\V1\Twitter;

use App\Etis\Domain\Services\TwitterService;
use App\Http\Controllers\Controller;
use \Twitter;

class TweetsController extends Controller {

    public function getTweets($userName, $amount) {
        $tweets = Twitter::getUserTimeline([
            'screen_name' => $userName,
            'count'       => $amount,
            'format'      => 'json'
        ]);

        $TwitterService = new TwitterService(json_decode($tweets, true));
    }
}

so whats the issue?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire