Skip to content

Subdomain route::resource "mandatory parameters are missing" #844

@PhiloNL

Description

@PhiloNL

I'm having trouble posting data when using subdomain routes and a resource controller.

Route::group(array('domain' => '{subdomain}.' . Config::get('app.domain')), function()
{
    //Resources
    Route::resource('project', 'ProjectsController');
});

// Adding this resolves the issue
// Route::resource('project', 'ProjectsController');

When I try to set the action of my form to the store method:

{{ Form::open(array('action' => 'ProjectsController@store')) }}

I get the following error:

MissingMandatoryParametersException: Some mandatory parameters are missing ("subdomain") to generate a URL for route "project.store".

Also another issue when redirecting:

return Redirect::action('ProjectsController@show', array('1'));  // Error (see below)
return Redirect::action('ProjectsController@show', array('mysubdomain', '1'));  // Works, when manually passing the subdomain, but is this required?

InvalidParameterException: Parameter "project" for route "project.show" must match "[^/]++" ("" given) to generate a corresponding URL.

Adding the subdomain as extra parameter to the form does not resolve the issue.
Any idea what the problem could be?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions