Support the ongoing development of Laravel.io →
posted 9 years ago
Views
Last updated 2 years ago.
0

At the moment I'm just doing $theUrl = action('CalController@index') . '/' . $first . '/' . $last . '/' . $age; ... which works, but it's not exactly pretty.

0

you can use like this;

Route::get( '/ical/{name}/{surname}/{userId}', [ 'as' => 'ical', 'uses' => 'AalController@index' ] )->where( [
        'name'    => '[A-Za-z]+',
        'surname' => '[A-Za-z]+',
        'userId'  => '[0-9]+'
    ] );

after you can call the route

$url = URL::route('ical', ['name'=>'john', 'surname'=>'smith', 'userId'=>15]);

its result = http://example.com/ical/john/smith/15

Last updated 9 years ago.
0

barisbora said:

you can use like this;

(snip)

Cool, thanks. I'll give this a go when I get home.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.