right way to construct and accept GET request in Laravel with long parameter (array)

I am new to Laravel. I do not know the right way to construct and accept GET requests.

I need to send the following request (en and es are language codes):

translation/next-word/en/es

and in Controller I have

public function getNextWord($langfrom, $langto) {

However, now new requirement came and I also have to send a list of IDs (on my client side it is an array (for instance, [1,5,12,15]), but it could be long list (about 100 IDs). Thus I am not sure how to send this ID array to controller and also accept it in controller method.

My old client side request (without categories):
// var categories = [1,2,5,6,17,20];

var url = "translation/next-word/en/es";
        $.ajax({
            url: url,
            method: "GET"                
        }).success(function(data){
            ...
        });
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s