Laravel 10x Sandbox Project
Welcome to the Laravel 10x Sandbox project! This repository serves as a test environment for different purposes. The project is containerized using Docker to ensure a smooth and consistent setup across different machines. Below are the instructions to set up and run the project.
Prerequisites
- Docker - Ensure Docker is installed on your machine.
- Docker Compose - Docker Compose is used to define and manage multi-container Docker applications.
Setup & Installation
-
Clone the Repository
Start by cloning the repository to your local machine:
git clone https://github.com/Elentra-Training/laravel-sandbox.git laravel-sandbox cd laravel-sandbox
-
Start Docker Containers
Use Docker Compose to build and start the services:
docker-compose up --build -d
This command will:
--build
: Build the images if necessary.-d
: Run the containers in detached mode (in the background).
-
Setup Laravel Environment
After the Docker containers are up, copy the
.env.example
to.env
:cp .env.docker .env
Then go into the
sandbox_app
container and execute the installation command.docker exec -it sandbox_app bash
This command will install all composer dependencies, generate the application key and run migrations.
install-app
-
Setup Hosts Enviroment
Add the following line to your
/etc/hosts
file:127.0.0.200 laravel-sandbox.com
You can change the IP address to whatever you want with the following env var.
WEB_HOSTNAME=127.0.0.200
-
Access the Application
With the containers running, you should be able to access the Laravel application via your browser:
laravel-sandbox.com
Usage
Once you've set up the project, you can create features for the project.
Troubleshooting
If you encounter any issues while setting up or running the project:
-
Check Docker logs for any evident issues:
docker-compose logs
-
Ensure all Docker services are running:
docker-compose ps
-
Change any of the following environment variables in the
.env
file if you're experiencing conflicts with ips or ports:WEB_HOSTNAME=127.0.0.200 IPV4_NETWORK=173.25.2 REDIS_PORT=6380 DATABASE_HOST_PORT=3307
The above values are intended to avoid conflicts with other services running on your machine. You can change them to whatever you want.