Creating a Laravel Project3:34 with Jonathan Barrios
To start using Laravel, you'll need Composer, a PHP development tool that manages packages and libraries on your computer. Check the teacher's notes below to learn more about Composer. You'll also need a local development environment such as MAMP, which we’ll be using throughout this course. Besides Composer and MAMP, you’ll need a code editor like Visual Studio Code, which is what I’ll be using in this course. Check the notes below for instructions on how to set those up.
To start using Laravel, you'll need Composer. 0:00 A PHP development tool that manages packages and libraries on your computer. 0:03 Check the teacher's notes to learn more about Composer. 0:08 You'll also need a local development environment such as MAMP. 0:12 Which we'll be using throughout this course. 0:16 Besides Composer and MAMP, you'll need a code editor like Visual Studio Code, 0:19 which is what I'll be using in this course. 0:24 If you need some help, check the teacher's notes below for 0:27 instructions on how to set those up. 0:30 It's time to install Laravel. 0:34 First, make sure you have MAMP started. 0:37 Showing green dot indicating that the Apache and 0:40 MySQL servers are both up and running. 0:43 If you're using Windows, 0:46 check the teacher's notes on how to install XAMPP and Git Bash. 0:48 Next, create a new directory where you want to keep your Laravel applications. 0:53 For this example, create a new folder inside of 0:57 MAMP in the htdocs directory named laravel_apps. 1:03 When creating a new project, you can name your working directory whatever you like. 1:11 Finally, open the terminal and navigate your working directory. 1:17 By typing cd, space and 1:20 dragging the working directory into the terminal like this. 1:22 This will reveal the path of your working directory, 1:28 making it super easy to navigate. 1:31 Once you hit Enter, you can see that you are indeed in the laravel_apps directory. 1:34 The create-project command tells Composer to create a new project from an existing 1:42 package. 1:47 The --prefer-dist flag tells Composer to download and 1:49 unzip archives of the dependencies using GitHub or another API. 1:52 Which speeds up the downloading of dependencies. 1:57 Check the teacher's notes below for more on APIs such as GitHub. 2:00 laravel/laravel indicates that this type of project,is a Laravel project. 2:05 Finally, treehouse is the name of the project. 2:11 But feel free to use whatever name you'd like for your project name. 2:14 After the Laravel project has been created, move back into the terminal, 2:19 and into the project directory, like this, cd treehouse, Enter. 2:26 Now you can see that we've moved from the laravel_apps directory 2:32 into the treehouse directory. 2:35 To open your project in Visual Studio Code on a Mac, 2:38 drag your project folder into the Visual Studio Code icon located in the dock. 2:41 Alternatively, you can also open the terminal. 2:51 Then type code, space, period, 2:55 Enter to open Visual Studio Code in your current working directory. 2:58 If your copy of Visual Studio Code didn't open, or 3:04 if you're using Windows, check the teacher's notes 3:07 on how to install the shell command in Visual Studio Code for Mac and Windows. 3:10 We're off to a great start. 3:16 But first we need to create a new user and matching database using phpMyAdmin. 3:18 In the next section, after we create our user and database, 3:25 we'll use Artisan to ensure that our database is connected to our application. 3:29
You need to sign up for Treehouse in order to download course files.Sign up