Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Gareth Watson
6,614 PointsSome questions regarding development with Laravel
Hi all,
I am currently working my way through the PHP lessons. I have completed both the Build A Simple PHP Application and Enhancing A Simple PHP Application and am 3 videos away from completing the Database Foundation before I continue with the PHP with MySQL module.
I am basically working my way towards the Laravel module which I am very excited about.
Even though I am not ready to start my Laravel learning yet I have watched some of the setup videos and I do have a question I am curious about. Once a project has been completed using Laravel and is ready for deployment to a live testing server (or production server) are things like composer required on the live server or is it simply a case of FTP-ing up the final php files and database?
In other words, is a final Laravel project dependent on anything beyond the PHP files and database that are generated during project development?
Thanks in advance, G
2 Answers
Jeff Wilson
Courses Plus Student 25,216 PointsI don't have real experience (i.e. production deployment experience) with Laravel, but from their documentation and the Composer documentation it works like NPM and the Rails bundler. Basically you don't actually include the dependancies in your project files, Composer "finds out which versions of which packages need to be installed, and installs them (meaning it downloads them into your project)" So you declare dependencies in Composer and then when you deploy you run Composer on the new server and it will use the composer.json file to go and find the libraries to install for your project.
Make sense? Not sure how much experience you have with package managers outside of PHP. Since you'll need to use a Laravel friendly host they'll likely already have all the dependencies for Laravel installed on the server and you'll just have the composer install command to run. Look at the setup guides for hosts like https://forge.laravel.com/ and http://fortrabbit.com/. You'll be running the deployment from the command line by using Git - so you'll want to make sure you know Git and are comfortable with the CLI
Gareth Watson
6,614 PointsThanks for your reply.
I have zero experience with package managers so that will be part of the learning curve. In fact I think I will have to slow down and take the time to do the pre-requisite modules first. I have quite a bit of experience using the command line (I used to support a software system that ran on Redhat Linux) so at least that won't be completely new to me but I'll complete the module anyway just to make sure I don't miss anything.
Treehouse also advises doing the OOP PHP module as well so I'll do that too (I learnt to programme in Java a loooooooooong time ago so again hopefully that will not be too bad). I really want to jump into Laravel but I know it is better to take it slow and go through the required modules correctly.
I sent an email to our host last week asking about Laravel and they got back to say that a few of their other customers are running it with no problem so we should be good to go. It's dedicated managed server so I should be able to get installed whatever I need (I hope).