Things I need to do when starting a new Laravel Project


2 min read

This is another one of those ongoing posts...

The things I may or may not need to do, probably want to do when stating a new Laravel project.

In terminal

create the project itself

cd to the relevant directory and use laravel command to crate a new project in that directory.
cd documents/sites && laravel new dogtracker

Node Package Manager stuff

First I need to install node package manager.
When inside terminal:
npm install
This will allow me to do stuff like create another build script for my CSS and JS, which is so cool as it acts like a cache buster and automatically minimise and so on.
To create a build script I need to:
npm run build
But if I have a lot of CSS work going on and I'm just experimenting will want to be in dev mode which allows hot reload while I'm experimenting around - cool right
To get into dev mode:
npm run dev
And to get back out again:

Git & GitHub Connections

Cause I really want those green squares! ๐ŸŸฉ ๐ŸŸฉ ๐ŸŸฉ
In Terminal
First things first to initialise git in the working project
GIT init
I need to add my project files with the command:
git add .
this adds all files
next i need to commit the change to the main branch and create a message that describes what I'm doing (always add a message)
git commit -m "whole project added
Now,x it's time to leave the terminal and go to my GitHub profile.
I need to create a repository, name it (make it private whatever) and when I get the option after creating those settings I go back to the terminal - this example case uses a respositor called dog tracker.
add these three commands:
The first one is a full line but hashnode doesn't want to include the @ symbol.
git remote add origin
git branch -M main
git push -u origin main

if that's not clear then do it like this โฌ‡๏ธ

If I go back and refresh Github now
And I will have a green (or greener) green square ๐ŸŸฉ