5 ms·
I'll go against the flow and say hell no!... I've been part of teams that pride themselves on using propel + klein to build an app in a non-framework. If you
by gremlinsinc 9y ago
I'll go against the flow and say hell no!...
I've been part of teams that pride themselves on using propel + klein to build an app in a non-framework.
If you want a light framework just go with lumen, flask, sinatra. Ymmv.
All new devs wasted a lot of hours learning propel and klein and it didn't always do what they wanted/needed, and the code wasn't the prettiest, where as most knew laravel, and longed for the comfort/sanity of coding in laravel.
Sure, for a hobby project/side project this is a good practice to become a better dev, and understand how a mvc framework is built, but for a large code/team it's best to go with something established so new devs hit the ground running without having to learn a ton of stuff.
It's easier to find a 'laravel dev', than it is to find a 'custom built mvc dev with extensive experience in x, y, z packages'.
- wvenable 9y agoI've worked in countless languages and used plenty of frameworks (and done a ton of PHP development) but I really don't understand Laravel. You have to do a big dance of putting files in all right places and implementing all the right interfaces -- as you would with any framework -- but Laravel doesn't seem to give you anything for your trouble. Take, as one example, validation -- you still have to write virtually everything yourself! There are some very basic hooks and some wire but that's all. For all the trouble, I expect more actual features from my framework.
- _s 9y agoThe opinionated flavour makes a lot more sense in a large team - I can pickup a Laravel App, and if it has followed convention, run composer install and be productive within a matter of minutes.
- NightlyDev 9y agoTbh, a developer should be able to do the same thing if PSRs are used for the project.
- NightlyDev 9y agoYou don't have to do everything yourself, most things are abstracted and easily accessible. It's a framework, it's job is to make it easy to structure the site and handle common tasks for you. Laravel does have validation built in. You might have to put custom rules to use every now or then, but I don't see a way around that. But laravel sure has its cost when it comes to performance - it's not possible to have it both ways.
- wvenable 9y agoLaravel has a weird validation abstraction but you still have to do all the work. I'm used to being able to define my model have all my validation rules derived automatically (so I'm not repeating myself everywhere) and displayed automatically. Laravel just makes you learn a whole bunch of new conventions and functions but you still have to do it all yourself. I don't see the value of: validate('title' => 'required'); vs. if (empty('title')) $errors[] = 'Title is required.' Especially when this happens at the controller level.
- kilburn 9y agoTo be fair, validation at the controller level is recommended only for simple cases. See form request validation [1] for more complex situations that require better code decoupling. That being said... yes, the validation system is lacking. For instance, there's no built-in way to perform sanitization before validation, nor normalization afterwards. Definitely one of the parts that I like less about the framework. [1] https://laravel.com/docs/5.6/validation#form-request-validation https://laravel.com/docs/5.6/validation#form-request-validat...
- wvenable 9y agoThat form request validation is such a strange level of abstraction. It makes far more sense to me to validate the model than to validate each individual HTTP request. Why have a separate class/component that's highly tied to single controller or action? It just seems like dividing non-reusable logic up between files for no good reason.
- gremlinsinc 9y agoPutting files in the right places? You can technically put them anywhere you like, and just use proper namespacing. For example laravel defaults to App/ for models.. so App\User which is ugly if you have 50 models. I ALWAYS use App\Models\User instead, so I move it to the App\Models folder, put all my other models there and presto, chango. Have you looked at validation in laravel 5.6? Use Validator ... $v = Validator::make($request->all(), [ 'email' => 'required|unique:users' ]); if($v->fails()){ return $v->errors()->first(); } .. continue we passed validation.. If you can't grok the code above in laravel, not sure what you suggest that would be better.
- AFNobody 9y agoThe simpler the abstraction, the more likely the end product will not be a disaster if it is a critical system. Frameworks are development speed enhancements but frequently are not "better" in terms of mechanical function. Even "major" PHP applications built on frameworks (i.e. Magento 2) frequently lose site of those abstractions and create fundamentally flawed products where the solution is you need a software developer to spend hours on it just to make the thing "work" as advertised. This rush to abstract everything is good for developer productivity, to a point, but I've rarely seen it result in a better/saner product.
- NightlyDev 9y agoThough it's not like you don't need experience with those same packages if you go the laravel way. A developer shouldn't have an issue working with either. It's all PHP and all sane PHP frameworks are mostly based on the same concepts, with some tradeoffs here and there...