Next semantic version php (laravel)

Hi I would like to update a semantic version number using php for a three digit system in string form.
An example :

'1.0.0' => function => '1.0.1'
'1.0.12' => function => '1.0.13'

Does anyone know a solution to this problem?
Thanks in advance