4 ms·
I just downloaded and installed laravel yesterday. As a devops (more on the ops side) kind of guy, I was hoping for something simpler. I have a very basic PHP w
by dmourati 12y ago
I just downloaded and installed laravel yesterday. As a devops (more on the ops side) kind of guy, I was hoping for something simpler. I have a very basic PHP webapp I need to design with two or three user inputs. These inputs form a user-driven SQL query (AWS Redshift) and then generate html to create a graph (Google Charts).
I have a mockup in Balsamiq of how I want this to look. I also have a test query from PHP showing that I can connect to AWS Redshift. What I don't have is the PHP to render the user interface. Again, we are talking one text field, one three-way button and that's about it.
Anyone able to help point me in the right direction?
Thanks.
- BenBradleySmith 12y agohttps://laracasts.com https://laracasts.com is a website run by Jeffrey Way formerly head of web development at TutsPlus and a brilliant teacher. He has a number of lessons available for free at https://laracasts.com/tags/free https://laracasts.com/tags/free including a series of lessons taking you through most of the basics (https://laracasts.com/series/laravel-from-scratch/episodes/1 https://laracasts.com/series/laravel-from-scratch/episodes/1). It's only $9 a month which imo is great value. I'd take a look through the free lessons and if you like what you see sign up for a month or 2 and start building. In addition to this Dayle Rees has an excellent book which can be found at https://leanpub.com/codebright https://leanpub.com/codebright which takes you through all the basic stuff and more. I personally prefer Laracasts as I am more video inclined and Jeffrey is an incredible teacher but they are both great resources.
- noir_lord 12y agoSecond laracasts, it pretty much sets the bar imo for content of that type, it would be worth 3 times the price (but no one tells him). On top of which Jeffrey is just an all round nice guy (he does a bunch for the PHP community as well as some nice open source packages).
- mcdougle 12y agoDo you have experience in Rails? Honestly, Laravel just feels like "PHP on Rails" to me. It's a full framework like Rails, so it takes some getting used to. The Code Bright [1] tutorial was great for learning the syntax, and the Laravel documentation [2] helps during development I'm not sure what your idea is, exactly, but once you get Laravel up and running it's fairly easy to do what it sounds like you're saying. Create a Model to interact with the database, create a controller for your routing, and then a couple of views for your form/success page/etc. [1] http://daylerees.com/codebright http://daylerees.com/codebright [2] http://laravel.com/docs http://laravel.com/docs
- fideloper 12y agoI don't think I'd use a framework for that use case. I'd pull in the AWS PHP SDK (amazing that we can use three sets of acronyms like that) via Composer, and then create a "quick script", if such a thing exists, to handle orchestrating all of that. Rendering HTML isn't the highlight of Laravel (altho the template language is pretty nice)
- dmourati 12y agoI think the AWS angle is a bit of a canard in this situation. I'm a non-privileged user of the database just making simple read queries over SQL. The AWS SDK looks to solve problems I don't have.
- conradfr 12y agoDepends on what "basic PHP" really mean. Modern PHP can be overwhelming for people from PHP4 / 5.0 eras. I would (arbitrarily) reduce your choices to those two : - Your project is not public and/or not likely to evolve much beyond the initial requirements : get Bootstrap and use a "basic" PHP script. You can already do a lot with raw PHP with the SPL (autoloader etc), filters (http://www.php.net/manual/en/book.filter.php http://www.php.net/manual/en/book.filter.php), etc. - If you need more, use a microframework like Silex or Flight. The learning curve will be steeper, but you'll also get more feature out of the box, if you need them.
- dmourati 12y agoBasic really referred more to the webapp than the PHP aspect. I could have been clearer. My point is, the application is not complex.
- krapp 12y agoThe "Laravelesque" way to do this would be: - POST route to a controller which calls a model which handles the database stuff, then redirects to.. - the GET route which calls a controller which calls a model which pulls from the database and returns a View which parses the result of the query into a template. Although you could do it all inside the route closures as well if you wanted... I don't know how much extra overhead there is doing it one way versus the other. If you want to use Laravel I might suggest picking up one of the starters you can find on github or reading up on MVC, it's really not that hard although it can seem complicated because Laravel puts so much effort into trying to cover every possible model. Although, given what you're describing, Slim Framework with Twig and a simple class for SQL might be easier.