Docker Desktop: Ensure that Docker Desktop is installed and running on your system. You can download it from the official Docker website: https://www.docker.com/products/docker-desktop
-
Clone the repository
-
Open the terminal and navigate to the project folder
cd path/to/project
-
Start Laravel Sail
./vendor/bin/sail up
- This will build and start the necessary Docker containers for your Laravel application (web server, database, etc.).
- For the first time, this might take a while as it downloads the images.
- The
-d
flag (e.g.,./vendor/bin/sail up -d
) will run the containers in detached mode (in the background).
-
Run the migrations
./vendor/bin/sail artisan migrate
- This will run the migrations and create the necessary tables in the database.
-
Seed the database (Optional)
./vendor/bin/sail artisan db:seed
- This will seed the database with sample data.
-
Execute NPM commands
./vendor/bin/sail npm install ./vendor/bin/sail npm run dev
- This will install the necessary npm packages and compile the assets.
-
Open the browser and navigate to
http://localhost
-
To stop the containers, run
./vendor/bin/sail down
- This will stop and remove the containers.
- To stop the containers without removing them, use the
-d
flag (e.g.,./vendor/bin/sail down -d
). - To stop and remove the containers along with the volumes, use the
-v
flag (e.g.,./vendor/bin/sail down -v
).
-
To run the tests, use the following command
./vendor/bin/sail test
- This will run the tests and display the results.
Note: All php artisan commands can be run using ./vendor/bin/sail artisan
in place of php artisan
.