Skip to content

Installation

Clio Brichaut edited this page Jan 14, 2023 · 1 revision

On Mac

  1. Download the project with git clone https://github.com/cbrichau/LaravelAPI.git.

  2. Move into the project with cd LaravelAPI/app.

  3. Install the project's dependencies with 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 [source].

  4. Launch the containers with ./vendor/bin/sail up -d.

  5. Set up the database with ./vendor/bin/sail artisan migrate:refresh --seed.

  6. Test the app on http://localhost/api/documentation or with ./vendor/bin/sail artisan test.

On Windows

  1. Prerequisites:

    • Install Docker Desktop.
    • Install Ubuntu from the Microsoft Store.
    • Make sure you're running WSL 2 and that Hyper-V is enabled.
    • Enable Ubuntu in Docker Desktop under Settings > Resources > WSL INTEGRATION.
    • Make sure Docker Desktop is running.
  2. Using GitBash, download the project with git clone https://github.com/cbrichau/LaravelAPI.git.

Open the Ubuntu/WSL terminal for the next commands.

  1. Move into the project with cd /mnt/c/.../LaravelAPI/app.

  2. Install the project's dependencies with 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 [source].

  3. Open /app/.env in VSCode and change the line endings from CRLF to LF.

  4. Launch the containers with ./vendor/bin/sail up -d.

  5. Set up the database with ./vendor/bin/sail artisan migrate:refresh --seed.

  6. Test the app on http://localhost/api/documentation or with ./vendor/bin/sail artisan test.

Clone this wiki locally