DEV Community

Discussion on: Design Patterns in PHP: Facade (with Laravel)

Collapse
 
innoflash profile image
Innocent Mazando

Nice post @ashraf.

I think the facade name did not need a Facade suffix. Convectionally it should plainly be what it represents like a simple Twitter.

Examples are the Mail and Auth facades :)

Thanks for the post.

youtube.com/watch?v=zR6JnwH7MSQ

Collapse
 
ahmedash95 profile image
Ahmed Ashraf

Thanks for the feedback. you are right but few months ago I found it useful to follow Spatie naming classes guide guidelines.spatie.be/code-style/la... as it really helps to just find your target. if you have a Model, Controller, Facade, and Service for Twitter naming them Twitter, TwitterFacade, TwitterController, and TwitterService would help a lot to just read and get what each class referring to

Collapse
 
amiut profile image
Amin A. Rezapour

You are correct about Service and controller, but for facade since it's purpose is to replace the complex Twitter class with a more simplified version , Twitter without Facade suffix might be enough.