jeudi 22 octobre 2015

Laravel cast route parameter to Integer

I really like the idea of Route Model Binding.

Is there a similar way to cast parameters (which are Strings) to Intergers?

The reason is that I often have the parameters year and month, but I would like to have it as an Integer, because the database seems to handle String and Integers in different ways.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire