Comments (11)
@zanozik you are being disrespectufl and kind of annoying. You can criticize but being respectful.
from laravel-best-practices.
This "best practices" guide is bad on many levels
This repo represents my experience which is based on ~200 Laravel projects I worked on, books I've read, thousands of answers on StackOverflow, and other Laravel communities. So, I know something. But I don't know everything, so if you feel you know better, just create a new discussion about a specific issue and see if people will like what you're saying. Just saying "this repo is bad" and "this statement is wrong" is nothing.
Also, you're saying this guide is bad. It sounds like you've found a better source, can you share it with us?
from laravel-best-practices.
200 projects and you didn't notice that Laravel framework is using Interface suffix? Sounds legit.
from laravel-best-practices.
@thomasmoors when I've added the naming conventions, I've done a lot of research and I've figured out that most Laravel packages and the framework itself didn't use the SomeInterface
convention at the time. You probably right about this since PSR naming convention says this
Interfaces MUST be suffixed by Interface: e.g. Psr\Foo\BarInterface
You could open a new poll on this.
from laravel-best-practices.
@thomasmoors You could open a new issue and ask people to upvote/downvote with reactions (thumb up or thumb down).
from laravel-best-practices.
@thomasmoors , I was mislead by your description. I totally agree with you.
This "best practices" guide is bad on many levels and this is just only one example. How about The best way is to use specialized PHP to JS package to transfer the data. statement?
I guess the guide author knows better than Laravel devs...
Anyway, moving on :)
from laravel-best-practices.
What are you taking about? Only Traits are adjective. Interface may have "Interface" suffix
from laravel-best-practices.
What are you taking about? Only Traits are adjective. Interface may have "Interface" suffix
That is litterely an example that this guide puts under "Bad". So I disagree that your statement is true.
from laravel-best-practices.
200 projects and you didn't notice that Laravel framework is using Interface suffix? Sounds legit.
Check the default User model class which is used by most Laravel apps, what do you see there?
Check vendor/laravel/framework/src/Illuminate/Contracts
directory for dozens of Laravel interfaces.
As I said, I like the idea of using SomeInterface convention just because that's PSR friendly, but I'm not sure if the Laravel community likes that, so we need a poll.
Also, you chose to ignore my question about a better source. You call the source bad, so there must be a better source, right?
from laravel-best-practices.
@thomasmoors when I've added the naming conventions, I've done a lot of research and I've figured out that most Laravel packages and the framework itself didn't use the
SomeInterface
convention at the time. You probably right about this since PSR naming convention says thisInterfaces MUST be suffixed by Interface: e.g. Psr\Foo\BarInterface
You could open a new poll on this.
How exactly can I open a poll?
from laravel-best-practices.
Another convention that can be observed thoughout the framework is naming interfaces using adjectives and traits using verbs (?).
For example:
Illuminate\Contracts\Auth\Authenticatable
Illuminate\Auth\CreatesUserProviders
I think this solves the naming conflict quite gracefully.
from laravel-best-practices.
Related Issues (20)
- What PHP to JS package is recommended? HOT 4
- How about throw exceptions? HOT 5
- Do not get data from the .env file directly, why? HOT 2
- What about laravel Resources? HOT 3
- Wrong return type? HOT 1
- PSR-12 HOT 3
- What about translation variables? HOT 2
- Best
- Interface best practice HOT 5
- Converting from and back to json HOT 1
- Validation FormRequest HOT 1
- Looking for the repo owner HOT 8
- Typo Issue in example (Don't repeat yourself (DRY)) HOT 2
- Store dates in the standard format. Use accessors and mutators to modify date format HOT 11
- Seeder in singular -> Good, Seeder in plural -> bad (naming-conventions) HOT 2
- Recommended route name conflict?
- A tool that enforces all these best practices HOT 1
- Change test case methods to snake_case HOT 1
- Query Parameter Validation HOT 1
- La
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-best-practices.