(React + Tailwind) && (Inertia + Laravel) Starter Kit
Clone this repo and then change .env.example to just .env
Or, run
touch .env
and copy the contents of .env.example into your new .env file.
Paste this in your terminal:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" <br>
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Run the following in your terminal to move composer into your $PATH
sudo mv composer.phar /usr/local/bin/composer
If you run into any trouble, you can go here and read more: https://getcomposer.org/download/
npm install
composer install
php artisan sail:install
then type 0 for msyql, press enter
then:
php artisan key:generate
then just to double check run:
composer update
Add sail to your $path (so you can just use 'sail' in future terminal commands):
alias sail='bash vendor/bin/sail'
If you get a "sail command not found" then just re-run this anytime.
If you don't have Docker Desktop, you can download it here: https://www.docker.com/products/docker-desktop
Once it's open, run this in your terminal:
sail up
This will start the docker container(s)( If you get a "sail command not found" then you can run -- otherwise skip to the next step):
./vendor/bin/sail up
If you run into any trouble, the Sail documentation is here: https://laravel.com/docs/8.x/sail#introduction
Open a new tab in the terminal and run:
sail artisan migrate
Or if you're still getting the "sail command not found", run this:
./vendor/bin/sail artisan migrate
For a list of commands you can run, run:
./vendor/bin/sail artisan
Migrations need to be run using 'sail' instead of 'php' so that they are run inside the docker container
Now run:
npm run dev
Main page is here:
localhost
You'll need a DB client. I like to use TablePlus.
You can download it here: https://tableplus.com/.
Once you have that downloaded, open it up and click "create a new connection".
Your info should look something like the image below (click "Test" for the boxes to turn green), and then click "Connect":
If you have trouble connecting to DB, see: https://laracasts.com/discuss/channels/servers/laravel-sail-no-dbdb-user-created