Playing
02. Quick project setup

Transcript

00:00
Okay, let's start out with a really basic Laravel project We're gonna go ahead and use the Laravel installer here to create a new project called friends That should take just a second while that's finishing. Let's head over to the starter kit section over on Laravel
00:15
We're gonna be using Laravel breeze just provides us a really nice easy way to get set up So we want to go ahead and run the composer command for this. So let's go ahead and do that now While that's finishing we want to go ahead and call the breeze install artisan command It's gonna go ahead and publish a load of controllers and all that kind of stuff
00:34
We're not actually in that directory at the moment. So let's cd into that first to run both of these commands and Once that's done, let's do that install command great. Now. This is telling us to run npm install so let's do that as well and npm run dev just to compile all of our assets and
00:52
Then finally we can go ahead and migrate now just while this is finishing We'll go ahead and set up our EMV file to hit our database, which I've already got set up over here called friends Okay, so all of that is finished. Let's go and just open up our EMV file. Let's come down to our database section here I'm using Postgres here, but it doesn't matter if you're using my SQL
01:15
We've already got that database called friends and I'm just gonna change over the username. That's pretty much it So we can go ahead and run php artisan migrate and we should be good and we've got an error here So database friends does not exist. Did I spell it wrong? I Think I did. So let's try that one more time. And there we go
01:34
So all of the standard tables in here that we would expect from Laravel now We've already got Laravel breeze installed for the purpose of this course Let's just go ahead and use php artisan serve just to serve this locally Really really easy to get set up with then and we can head over and just register a new account
01:50
Which is exactly what we want to do. So let's go ahead and just register an account with some details here And once we've done that we are in we've see our dashboard We've got our templates set up nicely and we don't need to do too much work to get this looking. Okay Okay. So now that we've got this done, we're just gonna make sure that we are also running over in our editor
02:12
NPM run watch just to continuously compile our assets and we'll keep this editor part free or this Terminal part free so we can run any commands that is pretty much all we need for this course Okay, so we're gonna head over to the next episode Schedule out the friends page that we saw from the introduction and then we'll carry on

Episode summary

In this episode, we kick things off by setting up a fresh Laravel project called friends using the Laravel installer. After creating the project, we jump right into installing Laravel Breeze — it's a simple starter kit that gives us everything we need for authentication and a basic frontend, perfect for getting going quickly.

We walk through running the necessary composer and artisan commands, taking care to cd into our project directory when needed. Next up, we install our JavaScript dependencies with npm install, compile the assets with npm run dev, and then sort out our database connection by tweaking the .env file (in this case hooking Postgres up, though you can use MySQL too).

After that, we run our database migrations—after correcting a minor typo in the database name!—and get all the standard Laravel tables set up for us. We wrap things up by spinning up a local server with php artisan serve and testing the registration flow to make sure everything is working as it should. Finally, we open up our code editor and run npm run watch to keep our assets compiling while we work, keeping our terminal handy for future commands.

That's the quick project setup sorted! In the next episode, we'll start working on the friends page and continue building from there.

Episode discussion

No comments, yet. Be the first!