Question: I've got another interesing programming/mathematical problem.
I want to write an application, find the 42th number which sum of its digits is 42, i need find number which have sum of its digits is 42 and add to new array to print the 42th number in new array which have about 50 numbers have sum of its digits is 42. Thank you for taking the time to help.

@implementation AppDelegate

```
static NSArray *newArray ;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

    int numberWithSum42;
    for (int i=69999;i<80000;i++)
    {
        int x=[self findTotalNumber:i];

        if(x==12){
             numberWithSum42=i;
            newArray = [NSArray arrayWithObjects:[NSNumber numberWithInt:numberWithSum42], nil];
        }
        NSLog(@"%@",newArray);
    }
    [self print42ndVariable];
}
-(void)print42ndVariable{
    int j;
    int count = (int)[newArray count];
    for (j = 0; j < count; j++){
        NSLog (@"42nd variable of array   = %@", [newArray objectAtIndex: 42]);
    }

}
-(int)findTotalNumber:(int) n{
    int s=0;
    while (n>0)
    {
        int k=n%10;
        s=s+k;
        n=n/10;
    }
    NSLog(@"%i",s);
    return n;
}

```

@end

Answer: 
If you want to get the parameters in the \_\_construct of your controller you could do this:

```
class HomeController extends \BaseController
{
    public function __construct()
    {
        $this->routeParamters = Route::current()->parameters();
    }
}

```

it will return a key value list of parameters for the route (ex: `['companyId' => '1']`) [@see \Illuminate\Routing\Route](https://github.com/laravel/framework/blob/master/src/Illuminate/Routing/Route.php#L319)

You can also get a specific parameter using the [getParameter()](https://github.com/laravel/framework/blob/master/src/Illuminate/Routing/Route.php#L268) or [parameter()](https://github.com/laravel/framework/blob/master/src/Illuminate/Routing/Route.php#L280) methods.

**NOTE:** I'm not sure this is such a great idea tho. There might be a more elegant way to solve or better approach to your problem.
If you want to make the process simpler, route model binding seems to be the easiest way to go. Instead of having to fetch for the right Model instance in every action of your controller, you pass the right Model to your controller during the routing process.

But you have to use Route::resource. In routes.php :

```
Route::bind('company', 'Company');
Route::resource('company', 'HomeController');

```

Then you have an instance of category passed to your controller. For example for /company/1 :

```
public function show($company)
{
    // Here you can use, for instance, $company->name
}

```