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

Rest Routing Bundle Laravel Package

handcraftedinthealps/rest-routing-bundle

Symfony bundle that restores FOSRestBundle-style automatic REST route generation. Supports format options and method/name prefixing, and includes a command to dump/convert type: rest routes into standard Symfony routes for migration or opt-out.

View on GitHub
Deep Wiki
Context7

RestRoutingBundle ⛰

GitHub license GitHub tag (latest SemVer) Github Test workflow status

This bundle provides the automatic route generation for the FOSRestBundle 3.0.

Documentation

Read the Documentation

Installation

All the installation instructions are located in the documentation.

Opt-out of the type: rest routing

You might want to migrate away from this bundle and use normal Symfony routes. Via the command inside this bundle you can convert all type: rest routes to normal Symfony routes:

bin/console fos:rest:routing:dump-symfony-routes

# filter by a specific controller
bin/console fos:rest:routing:dump-symfony-routes --controller="your.controller.service"

# filter by a specific name prefix
bin/console fos:rest:routing:dump-symfony-routes --name-prefix="your_prefix."

Copy the result into a routing.yaml file of your choice.

Switching from FOSRestBundle

If you did before using the FOSRestBundle which removed the auto route generation the switch is easy. After you did successfully install the bundle change the configuration to the new bundle:

before

fos_rest:
    routing_loader:
        default_format: 'json'
        prefix_methods: true
        include_format: true

after

handcraftedinthealps_rest_routing:
    routing_loader:
        default_format: 'json'
        prefix_methods: true
        include_format: true
        # optional set supported formats else the configured one from fos_rest are used if installed:
        # formats:
        #     json: true
        #     xml: true

Update the classes (not necessary but recommended):

// Replace ClassResourceInterface
-use FOS\RestBundle\Routing\ClassResourceInterface;
+use HandcraftedInTheAlps\RestRoutingBundle\Routing\ClassResourceInterface;

// Replace RouteResource
-use FOS\RestBundle\Controller\Annotations\RouteResource;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\RouteResource;

// Replace NamePrefix
-use FOS\RestBundle\Controller\Annotations\NamePrefix;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\NamePrefix;

// Replace Prefix
-use FOS\RestBundle\Controller\Annotations\Prefix;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\Prefix;

// Replace NoRoute
-use FOS\RestBundle\Controller\Annotations\NoRoute;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\NoRoute;

// Replace Version
-use FOS\RestBundle\Controller\Annotations\Version;
+use HandcraftedInTheAlps\RestRoutingBundle\Controller\Annotations\Version;

License

This bundle is under the MIT license. See the complete license in the bundle.

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.
bugban/symfony
beyonder-capi/workflow-extensions-bundle
beyonder-capi/job-queue-bundle
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin