You can run sh setup.sh
which will do all the steps for you ;)
cp .env.example .env
When using laravel sail. We need to run sail
command before doing anything else. You must run following command which will ask docker to install all required dependencies through docker with required php version.
sudo docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
Now this will make sail
command available for us to be used for installation purposes.
We need to prepare containers, etc. run ./vendor/bin/sail build
it will take a bit.
./vendor/bin/sail up -d
Now you should have everything ready for the env to work.
./vendor/bin/sail artisan key:gen
Now, you should have a domain called http://laravel.test
./vendor/bin/sail artisan migrate
That's it.
-
If you hit some address already in use errors
sudo service nginx stop && service apache2 stop && service mysql stop
-
update
~/.bashrc
or~/.zshrc
to make your life easier.alias sail="./vendor/bin/sail"
-
If you are getting permission issue at step 6 for the moment (LOCAL ONLY) run
chmod -R 777 storage/logs
-
For using git you can run
./vendor/bin/sail bash
thengit
for authentication you can generate an ssh key withssh-keygen
store in default location. runcat ~/.ssh/id_rsa.pub
copy content gotohttps://bitbucket.org/account/settings/ssh-keys/
add your key. Now, you should be able to make a push from container but this is just temporary not permanent.
- To ensure code formatting and standards, run
composer phpcs
for static analysis - To fix issues from above automatically run
composer phpcbf
. Not all issues will be autofixed, manual fixes might be needed.
-
Run
./vendor/bin/phpunit
to run the entire test suite -
To run a single test
./vendor/bin/phpunit --filter test_if_a_product_can_be_created