Artisan CLI3:31 with Jonathan Barrios
Artisan CLI is the command-line interface is included with Laravel, and it provides useful commands for everyday development tasks, from building controllers to database migrations using Tinker. Tinker is a handy CLI tool that takes in a single user input, evaluates it, and returns the result to the user, also known as REPL, which is short for read-eval-print-loop. Tinker is an excellent tool for database development in general, and we’ll use it when we migrate and seed our database.
Welcome back. 0:00 Now that we're getting the hang of routing, 0:01 it's a good time to talk about Laravel's command line interface artisan. 0:04 Artisan is included with Laravel and 0:09 it provides useful commands for common development tasks from 0:11 building controllers to database migrations using Tinker. 0:16 Tinker is a handy CLI tool that takes in a single user input, 0:20 evaluates it, and returns the result to the user. 0:25 This tool is also known as REPL, which is short for read, evaluate, print, loop. 0:29 Tinker is an excellent tool for database development in general, and 0:36 we'll use it to migrate and seed our database. 0:41 If you want to browse through a list of available commands at any time, 0:44 use php artisan list. 0:50 To get started, let's take a closer look at the essential artisan CLI commands. 0:52 Artisan provides many helpful commands that speed up development, 0:58 complete with a list of available artisan commands at your fingertips. 1:03 Just type php artisan list to see the list at any time. 1:07 Wow, that's a big list. 1:14 But don't worry, in time you'll learn all of these commands one by one as you 1:16 start developing more Laravel applications. 1:21 You've already used php artisan migrate to test the database 1:24 credentials you created earlier. 1:28 So you're already on your way. 1:31 If you want to see the essential information for 1:33 any artisan command, use php artisan help, 1:36 followed by the name of the command you want information on, such as migrate. 1:39 Remember, if you wanna see a list of all of your routes and 1:49 information like the URI, middleware, and 1:56 more, use this command, php artisan route:list. 2:01 In the next section, you'll use php artisan make colon controller 2:07 to create a controller instead of writing it out by hand. 2:13 If you want to build a model and you forgot what arguments or 2:17 option it takes, just remember to use the artists help command like this. 2:22 Maybe you forgot the command to make a controller. 2:28 No worries, try this one instead. 2:31 When you want to look inside of your database, perform database migrations, 2:35 or if you're going to seed your database, use this command, php artisan tinker. 2:40 This is the tinker shell. 2:48 To exit the shell use Ctrl + C. 2:50 Last but not least, 2:50 when you need inspiration, 2:54 use this command, php artisan inspire. 2:58 How cool is that? 3:06 As you can see, Laravel provides a cornucopia of robust tools that speed 3:09 up the modern web development process. 3:13 It's not hard to see why Laravel is the preferred PHP framework in 2020. 3:16 Now that we've covered artisan and some of the commands it makes available to us, 3:21 let's create our first controller in the next section. 3:26 See you there. 3:30
You need to sign up for Treehouse in order to download course files.Sign up