Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laminas Mvc Laravel Package

laminas/laminas-mvc

Laminas MVC is a modular, event-driven MVC framework for PHP applications. It provides routing, controllers, view integration, dependency injection, and configuration management, helping you build scalable, maintainable web apps and APIs on top of Laminas components.

View on GitHub
Deep Wiki
Context7

Routing

Routing is the act of matching an HTTP request to a given controller.

Typically, routing will examine the request URI, and attempt to match the URI path segment against provided constraints. If the constraints match, a set of matches are returned, one of which should be the controller name to execute:

'home' => [
    'type' => Laminas\Router\Http\Literal::class,
    'options' => [
        'route' => '/home',
        'defaults' => [
            'controller' => Application\Controller\IndexController::class,
            'action' => 'index',
        ],
    ],
],

Routing can utilize other portions of the request URI or environment as well, such as the host or scheme, query parameters, headers, or request method.

Configuration File

Routing is configured at the module level. For a module Application, the configuration will be located at module/Application/config/module.config.php:

return [
    'router' => [
        'routes' => [
            'home' => [
                'type' => Laminas\Router\Http\Literal::class,
                'options' => [
                    'route' => '/home',
                    'defaults' => [
                        'controller' => Application\Controller\IndexController::class,
                        'action' => 'index',
                    ],
                ],
            ],
            // additional routes
        ],
    ],
];

Note that when adding multiple routes, the last route in the list will be checked first.

HTTP Route Types

Laminas MVC ships with the following HTTP route types:

Hostname : matches domains and subdomains.
Example: docs.laminas.dev. Literal : matches an exact URI path.
Example: /contact-us Method : matches HTTP verbs.
Example: post,put for a route that submits a form. Part : allows crafting a tree of possible routes based on segments of the URI path.
Example: /blog can have child routes with /rss and /subscribe, which would match /blog/rss and /blog/subscribe respectively. Regex : matches a URI path using a regular expression. Example: /product/(?<id>[0-9]+) would match /product/001, with the id parameter containing 001. Scheme : matches the URI scheme.
Example: https. Segment : matching one or more segments of a URI path.
Example: /:blog/:article would match /blog/why-use-mvc, with the article parameter containing why-use-mvc.

Learn more about routing in the laminas-router documentation.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle