multiple parameters

There's an instance that we need to pass a multiple parameter to our route. Just remember that the {your-desired-name} is strict and does not allow same {your-desired-name} in the defined uri. Then this is how we do it in sprnva.

Route::get("/project/view/{id}/test/{userid}", ['ProjectController@view', ['auth']]);

Then the controller's method accepts the parameters.

<?php

namespace App\Controllers;

class UsersController
{
    public function view($id, $userid){
        //code here
    }
}

Last updated