Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can insert two variables into the URL of your PHP Laravel project by using the route function with parameters. Here's an example:

Route::get('/user/{id}/profile/{name}', function ($id, $name) {
    return 'User '.$id.'\'s profile name is '.$name;
});

In this example, the URL has two variables {id} and {name} which will be passed to the closure function as parameters. The first parameter will be used for the id variable and the second parameter will be used for the name variable. You can then use these variables to perform any required actions in your application.