8 ms·
Laravel : A New PHP Framework
- rorrr 14y agoIt needs a 2-minute video to "sell" it to me. There are literally hundreds of PHP frameworks. Your list of "highlights" didn't make me want to try it.
- mahmud 14y agoHow about a webinar, or a conference call? I think written documentation is just fine.
- MrMatters 14y agoWritten documentation is fine, but a quick video would help. That's not unreasonable for something like this, you could have replied more nicely. Instead of like a terrorist.
- capex 14y agoDid you just try to pick on his name?
- mahmud 14y agoI didn't think he was. I think it was stylistic hyperbole; deliberate heavy-handed response, just I pulled out the "webinar" gun to label someone a "suit" :-)
- mahmud 14y agoYou have been conditioned by far too much hype. You need to evaluate your software, not be sold on it.
- ya3r 14y agohttp://getlaravel.com/ http://getlaravel.com/
- rorrr 14y agoThanks. This is pretty good.
- kumarshantanu 14y agoIt appears more functional in style: http://laravel.com/docs/routing#the-basics http://laravel.com/docs/routing#the-basics Good to see that.
- ellie42 14y agoValidations in routes, you're doing it right https://github.com/laravel/pastes/blob/master/application/routes.php#L52-66 https://github.com/laravel/pastes/blob/master/application/ro...
- tabbyjabby 14y agoI think the routing in that example is meant to be Sinatra-style routing for lightweight applications.
- fruchtose 14y agoI really like this approach. It's one of the reasons I like Express in node.js. I am by no means a fan of PHP after using it on several projects, but if I were forced at gunpoint I would look into Laravel. I also like the DB table creation code. ActiveRecord-type model delcarations are fine, but I'm interested in exploring Mongoose-type ORM, since I suspect it is more flexible in the long run.
- daylerees 14y agoHey, Dayle Rees here, (guy who made the getlaravel.com promo site) I also wrote the pastes app, and the reason I chose to use routes is that its a tiny application, and using routes avoided all the unnecessary "class fluff" allowing me to prototype quickly. On a large scale app I would have used controllers, which are also available. :)
- tar 14y agoWhat I would like to know is how exactly is this different from the hundreds of open source PHP frameworks available out there?
- kbanman 14y agoIt takes full advantage of recent advancements in PHP to facilitate more functional programming.
- Periodic 14y agoThis was what confused me. I look at the home page and the major features seem to be that it is well documented and has "bundles". That doesn't really tell me how it will make my development easy.
- balac 14y agoIt looks pretty nice! How can I be sure this will continue to be maintained far into the future though? At least with Zend / Symfony I know they are not going anywhere for the foreseeable future.
- markessien 14y agoThere needs to be a quick overview of the syntax or how it works. I don't want to read pages of documentation just to figure out how it looks like.
- neya 14y agoAgreed!
- kbanman 14y agohttp://getlaravel.com http://getlaravel.com
- Destroyer661 14y agoI found the quickest way to learn how to use it was just install it. The code is commented very well and is quite expressive in it's syntax so looking up the docs has been, for the most part, an exercise in "what params does Str::limit take?".
- digitalman 14y agoIt isn't new, but it's in the buzz. Let's face it, stateless MVC for the web is a local maximum. We can do much better, but not if we stick with this MVC crap.
- mahmud 14y agoWhere does it say stateless? seems like a stateful framework, it has fat-bottomed sessions: http://laravel.com/docs/session/config http://laravel.com/docs/session/config
- pestaa 14y agoWhat do you suggest as a replacement of MVC?
- lukifer 14y agoMVC seems an odd paradigm for the non-realtime web, when you have to instantiate every object on each request, and data update events are the exception, rather than the rule. For simple cases, I often fall into a (M/C)+(VL/V) pattern: model and controller fused into one layer, view-logic and view into another. If database logic is sufficient complex or used in multiple places, break it out into its own layer, same for view logic. No pattern can or should be a universal panacea for every use case. All that said, I'm really liking Laravel's approach. It's high time that PHP frameworks started getting wise to closures.
- corford 14y agoSome of the modern PHP frameworks are already wise to closures e.g. Silex.
- antihero 14y ago> when you have to instantiate every object on each request, The thing about this that it lends itself well to HTTP because HTTP is a request-based system. Once you start breaking down the barriers between requests you get all kinds of horrendous issues with race conditions and memory sharing and pain. Sessions just about get by this because they are per-user and people don't oft do huge amounts of things concurrently. PHP is also designed on a per-request basis.
- bobsy 14y agoIts a good framework but the development cycle is far to fast. Every few months there is a new full iteration where core functionality is added and development practices change. I feel it would be far more usable and popular if the dev cycle slowed and the framework was allowed to mature and gain some traction.
- kbanman 14y agoIt will slow down shortly, I expect. Taylor has only recently started working full-time on the framework and as a result has been able to "fill out" the framework with community-requested features at a quick pace. It's just a matter of time before it tapers off; there's no point in stagnating the development of such a young and novel framework for what IMO are silly reasons.
- fatjokes 14y agoPlease let PHP die.
- tylermenezes 14y agoPHP is not dying.
- neverminder 14y agoIn a real world PHP is more alive than most of other web languages. Our salaries are paid by businessmen and they don't give a shit how it works as long as it works.
- nestlequ1k 14y agoThis is how PHP dies. You end up with 100 frameworks, and it's impossible to hire anyone who has experience with the framework you are using.
- envex 14y agoAny developer worth his weight should be able to adapt to any framework written in the language he knows. If you know PHP/Ruby/Python/etc, you should be able to pickup a new framework within a day or two.
- popasmurf 14y agoYou should check out http://getlaravel.com/ http://getlaravel.com/ for some basic examples. I've been using Laravel for a few weeks now and I love it! The simplicity is next to none and it certainly has sped up my dev time. I'd recommend trying it for a week and see how you get on, I think you'll fall for it too.
- skrebbel 14y agoThat feels very lovely indeed. I really like the URL reverse routing, have been missing it from all the frameworks I tried.
- stephenr 14y agoWhy are so many PHP 5.3 frameworks like this ignoring namespaces. class Admin_Controller extends Base_Controller Seriously, someone thinks this is OK?
- soulclap 14y agoLaravel looks nice but I agree the internal/default naming conventions and structures are a bit odd for 2012. Hopefully this will be changed in an upcoming version.
- kbanman 14y agoWhat naming conventions specifically don't you like?
- soulclap 14y agoI guess it is mainly the fact that it's not using CamelCase for directories, all lower-case filenames, underscores in methods and class names (_Task). I am re-building a project in Laravel right now that I started with Slim, using a couple of Symfony components and own code and it's a bit of a turn-off for me that I ended up with quite mixed naming conventions now. With so many PSR-0 compliant PHP libraries and Composer on the rise, I just think it's the way to go. This doesn't stop me from trying Laravel though and so far this is the only thing that kind of bugs me. But don't get me wrong, basically I really like it so far.
- kbanman 14y agoLaravel makes extensive use of namespaces. The omission of namepaces in the case of controllers was a calculated decision. PHP's implementation of namespaces is... inadequate, and would have required annoying workarounds, so prefixing controllers was the better evil.
- ihsw 14y agoHow is PHP's namespace implementation inadequate? Use-as statements are the staple of every PHP library that uses namespaces, and this seems like a half-measure to placate less-experienced programmers.
- wseymour 14y ago"I was looking for a framework that supported PHP 5.3" You didn't look hard enough - see Lithium http://lithify.me http://lithify.me
- elliotanderson 14y agoOr Symfony2/Silex (based on Symfony, but designed more like Sinatra) http://symfony.com/ http://symfony.com/ http://silex.sensiolabs.org/ http://silex.sensiolabs.org/
- rizky05 14y agoHow about Yii? http://www.yiiframework.com http://www.yiiframework.com
- aneth 14y agoIf you want to create a new framework, why create it in PHP instead of switching to a language that is not deeply flawed? Any decision to use PHP on a green project seems to me the consequence of either technical decision making incompetence, or personal or organizational inertia, only the last of which is generally excusable. Using PHP otherwise seems like requiring your organization to use IE7 because you don't have the resources or energy to learn how to upgrade your infrastructure. At best it's a reasonable preservation of resource, but generally it's laziness. Learn something new and good - Ruby, Python, Java, Scala, C#, node, heck even Perl. I know I'll take hits for this, but seriously - how is continuing to use PHP any more justified than forcing old, flawed technologies like IE 7 unnecessarily on your organization? It's the same stubborn laziness and curmudgeonry - sticking to and forcing on others your bad status quo. PHP is better at nothing than alternatives (except introducing obscure bugs) and worse at so many things .
- maxpert 14y agoDefinately one of the most clean coding frameworks I've seen.
- pknerd 14y agoSo is it like making something similar to RoR? If yes then I am interested. RoR has spoilt me. Anything that is similar to RoR is highly attracted to me.
- thomseddon 14y agoCakePHP (http://book.cakephp.org/2.0/en/index.html http://book.cakephp.org/2.0/en/index.html) was initially built on ROR concepts. It follows a brilliant MVC pattern and gets you up and running with 'bake' (think 'rails generate') so if you know RoR and PHP, then you will feel very at home with Cake.
- arthurschreiber 14y agoYes, but their Model layer, in comparison with what ActiveRecord provides you with, is really not that great. One of the main aspects that I really didn't like was that the Model finder methods don't give you object instances back, but instead you get php arrays with the fetched data from the database.
- Kiro 14y agoWhy do you want object instances?
- thomseddon 14y agoPersonally, I have never found this in any way restrictive?
- davidlumley 14y agoBeing a micro framework it's more similar to Sinatra than Rails. In terms of main differences, it's PHP rather than Ruby which means it's verbose rather than terse and it's less automagical than Sinatra / DataMapper. If you need to use PHP for a project, then it's a great choice, but if you don't then you're better off with Sinatra (or Express and Node depending on what you're wanting to do).
- there 14y ago
- newbie12 14y agoI respect the work, but the samples look a lot like Symfony2, which has a huge community behind it. Sf2 has a learning curve but I'm not sure what problem Laravel solves that Sf2 (or its simplified kid brother Silex) doesn't already solve.
- lkrubner 14y agoI agree. If someone wants to launch a new PHP framework in 2012, they should at least talk about some of the leading PHP frameworks (Symfony, CodeIgniter, CakePHP, etc) and say why those frameworks are not adequate. Optionally, one could include a discussion of why one should use PHP, but I realize there is convenience and brevity to be gained from simply assuming you are talking to an audience that is already sold on PHP, rather than Java or Ruby or Python or Clojure.
- ams6110 14y agoDo all Java, Ruby, and Python frameworks include a discussion of why one should use those languages? Seems to me that when you're evaluating frameworks, the language decision is probably already made.
- rmATinnovafy 14y agoWhy not PHP?
- __mark__ 14y agohttp://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- lkrubner 14y agoImagine the conversation we would have if I hit the reply button and wrote: Why PHP? Seriously, it does not take the conversation forward.
- 14y ago
- daylerees 14y agoHey all, glad you find getlaravel.com useful. You could also checkout my blog which has 22+ Laravel tutorials including tips and tricks : http://daylerees.com http://daylerees.com . There is also an ebook available, linked from the site. Thanks!
- corford 14y agoIt looks interesting enough but a few things put me off: 1). Rolling its own ORM rather than using Doctrine. 2). YATL (yet another templating language). I wish the PHP world would just standardise on Twig. 3). Localisation seems a bit basic at the moment and it's a shame you have to define messages in a PHP array rather than something more portable like YAML. 4). Would have been great if it used Monolog for logging. On the plus side, I like the clean design and their approach for events looks cool.
- crynobone 14y ago1. You can use Doctrine bundle http://bundles.laravel.com/bundle/doctrine http://bundles.laravel.com/bundle/doctrine 2. It's also available. http://bundles.laravel.com/search?q=twig http://bundles.laravel.com/search?q=twig 3. Laravel focus on Event, so you can just set a listener to `laravel.language.loader` event and replace to anything you want it to be. Check http://www.keithloy.me/2012/04/yaml-config-files-in-laravel/ http://www.keithloy.me/2012/04/yaml-config-files-in-laravel/ 4. Same with Logging, just change https://github.com/laravel/laravel/blob/master/application/config/error.php#L64-67 https://github.com/laravel/laravel/blob/master/application/c...
- corford 14y agoThanks crynobone. Looks like I was too hasty in my criticism.
- voidr 14y ago1) Are you sure Doctrine is the best choice? 2) Why not simply use PHP for templating? 3) Using YAML would be just as bad, if you want to use something use something standard for localization like gettext or XLiff.
- corford 14y ago1). I'm not an ORM lover in general but, yes, if you're going to use an ORM and are basing your project on PHP, Doctrine is generally accepted as the best. 2). See: http://twig.sensiolabs.org/ http://twig.sensiolabs.org/ (Why yet another template engine?) 3). Personal preference I guess but I hate gettext. I much prefer the pattern of using labels in your template (e.g. menu.item1) and then looking up that label in the desired language file e.g. messages.en.yml. And I've never had a problem with translators working with YAML files (i.e. the syntax is easy for them to grok)
- jamesmoss 14y agoSomething I find really strange/frustrating with a few recent frameworks (Laravel included) is their overuse of static methods. You have these singletons floating through the framework which maintain state (Request, Session, Logging etc) but you can only ever access them statically. Seems like bad practise to me. What if you want to swap out Request for a mock during unit testing; since you've hard coded the Request class throughout your controllers how would you switch to a RequestMock class? What happens if you were dealing with more than one request (e.g in a HMVC setup).
- buremba 14y agoIt's very similar to Kohana 3.
- ttsaia 14y agoNot really. Kohana uses static methods to create objects extensively. Laravel looks largely procedural to me with static methods updating static classes.
- optymizer 14y agoLaravel does not cache routes defined in routes.php and especially those loaded from disk with Controller:detect(). What a pitty.
- johnchristopher 14y agoI don't totally agree with the author: coming fresh to php 5.3 without prior contact with the elephant isn't going to protect anyone from php's inherent inconsistencies or legacy way-of-doing-things for very long. I am specifically thinking about the different naming conventions for functions (sometimes underscore, sometimes not ). Of course my remark isn't about Laravel itself. With that said I used to try every "small but efficient" framework when I was a web developper and I would surely have tried this one with enthusiasm.
- EugeneOZ 14y agoglobals, static methods... bad code again.