Wrong route model binding for WorkShop Module

  • I stumbled into an issue today. When scaffolding a new module with the asgard:module:scaffold command, the model in the stub (modules/Workshop/Scaffold/Module/stubs/route-resource.stub) gets bound with the following code

    $router->bind('$PLURAL_LOWERCASE_CLASS_NAME$', function ($id) {
            return app('Modules\$MODULE_NAME$\Repositories\$CLASS_NAME$Repository')->find($id);

    However, the model binding in the route expects the $LOWERCASE_CLASS_NAME$ variable. Is there any reason why the $PLURAL_LOWERCASE_CLASS_NAME$ is used in this stub? I fixed my issue by changing the variable.

  • Global Moderator


    Hey, thanks for report i'll PR this asap, i did change to $LOWERCASE_CLASS_NAME$ must have forgotten to change binding.
    Update: Created PR at github

  • admin

    Tagged on 1.15.1 :)

Log in to reply