Start a new Laravel app
Last updated
Last updated
After cd
to the location where I want to contain the project folder for this project, run:
Follow their guide to installing in Laravel here:
In one terminal run vite:
In another terminal run laravel:
We'll assume that the .env file specifies that we're using mysql. You should have something like this in env for your local environment:
MySQL should probably already be running on your mac, and if so, then you can go ahead and connect to it:
use the username root
and no password, by entering this:
If you see an error like this: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
then it probably means you're not running MySQL on your mac.
To start it, run this:
Then try mysql -uroot -p
again
If it asks for a password, just click return.
If successful, then you'll be in mysql, and see this
Now, in mysql, create the database and name it whatever the project name is. The ;
is important to include at the end.
When finished, exit mysql with command+D or just type exit
Now back in the regular command line, run:
If you didn't create the database earlier, this command should prompt you to create a database now. Click yes if you see that prompt.
Then this will create and run a few migrations.
Choose MySQL
username: root
password: blank
database name: the project name (or whatever you named the db)
Test it and save