Laravel 以多个键作为主键的模型的路由

Laravel routing for a model with more than one key as the primary key

我的模型有 company_id 和 employee_id 作为主键。

一般情况下,我们使用/company/01/edit来编辑公司。但是员工的路由应该如何? company_id 和 employee_id 都必须在 URI 中。

您可以指定自己的方式来表示 url 中的复合主键,例如

/company/01+aa/edit

/company/key1=01&key2=aa/edit

/company/x01qaa/edit

/company/01/employee_id/02/edit