0

I'm new both to Laravel and PHP. I'm wondering why some sub-directories in Laravel application have files with first letter in uppercase and others in lowercase. Why this "inconsistency"?

1 Answer 1

2

According to the PSR-4 convention:

http://www.php-fig.org/psr/psr-4/

So that defines your name spaces. The convention is to match your directory names to your namespaces. If this were java, they'd all be lower case. However, in PHP, the namespace convention is to keep them all upper case. The other convention is that your namespace should match your directory structure for non third party code. However do keep in mind that with psr-4 this is not required.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.