Besides naming variables properly, you should use type hinting in order to make your code more readable. Don’t use $project for an id, instead use “int $projectId”.

I guess a picture makes it more clear:

carbon (1) carbon (2)