Skip to content

Conversation

@faytekin
Copy link
Contributor

To have more readable codes, small changes have been done. In Route, Controller names are given as arrays.

Example

use App\Api\V1\Controllers\LoginController;
$api->post('login', [LoginController::class, 'login']);

@taliptako
Copy link

@jasonlew @specialtactics Can you please merge this?

@specialtactics
Copy link
Member

Sorry, but I don't agree that this is more readable - it creates ambiguity because it is not clear what those array elements mean and what they relate to.

It is also not the way documented on the Laravel docs.

@faytekin
Copy link
Contributor Author

faytekin commented Jan 3, 2020

I think there has been a misunderstanding. You can set a route in this way at @specialtactics Laravel's own router. But this feature does not exist in Dingo API. I made it as an option. It does not break the current router. Anyone may use or just continue the current one.

@specialtactics specialtactics reopened this Jan 5, 2020
@specialtactics
Copy link
Member

Hey @faytekin that's fine in that case, I just requested one change which is to put a comment donoting what the code does.

Also there is a merge conflict with that file which you need to resolve.

@specialtactics specialtactics merged commit 05299b0 into dingo:master Jan 6, 2020
@specialtactics
Copy link
Member

specialtactics commented Jan 6, 2020

Merged, tagged

Thanks for your contribution !

@faytekin faytekin deleted the array_routers branch February 14, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants