Skip to content

Problems using array parameters on Route::group() #33

Description

@mvilera

Hey there,

I'm having problems using parameters like 'middleware' on Route::group() facade static method,

And using param 'middleware' like this:

Route::group(['middleware' => 'role:admin'], function () {
        Route::post('create','AppointmentController@create');
});

The error message is:
Symfony\Component\Debug\Exception\FatalErrorException: Illuminate\Routing\Router::loadRoutes(): Failed opening required 'Array' (include_path='.:/usr/share/php')

I'm aware that we can circumvent this problems by using middleware() on each post/get/method, but i was looking for a solution to avoid code duplication.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions