glhd / laravel-addressing

Laravel package providing addressing functionality
MIT License
62 stars 14 forks source link

Enable changing the route group prefix #5

Closed tormjens closed 6 years ago

tormjens commented 6 years ago

Thanks for a great package.

While using this I was annoyed that the name of the route group was pre-defined as it did not match up with the route naming convention for the rest of my application.

This PR solves this by allowing the prefix to be changed via a config file.

By default the routes returning the JSON responses are prefixed with galahad/addressing. You can change this by creating a config file (addressing.php) in your config directory with these contents.

<?php

return [
    'route' => [
        'prefix' => 'countries' // change this to whatever you'd like
    ],
];
inxilpro commented 6 years ago

This looks great! Thanks for contributing.

Would you be able add the config to the project per the Laravel docs? Basically a publishes() and mergeConfigFrom() call…

tormjens commented 6 years ago

Done! :)

inxilpro commented 6 years ago

Made a few minor changes. Do you see any issue with them?

tormjens commented 6 years ago

Looks good 👍🏻