Expand .gitignore for Laravel, update README with one-command setup, simplify env configs
This commit is contained in:
108
README.md
108
README.md
@@ -101,60 +101,90 @@ This template supports three database engines via Docker Compose profiles:
|
||||
|
||||
### Prerequisites
|
||||
- Docker & Docker Compose
|
||||
- Make (optional, for convenience commands)
|
||||
|
||||
### Setup
|
||||
### One-Command Setup
|
||||
|
||||
1. **Clone the repository**
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone <repo-url> my-laravel-app
|
||||
cd my-laravel-app
|
||||
|
||||
# Run setup script (MySQL is default)
|
||||
./setup.sh # Linux/Mac
|
||||
setup.bat # Windows
|
||||
|
||||
# Or specify database:
|
||||
./setup.sh mysql # MySQL (default)
|
||||
./setup.sh pgsql # PostgreSQL
|
||||
./setup.sh sqlite # SQLite
|
||||
```
|
||||
|
||||
**That's it!** The script will:
|
||||
- ✅ Configure environment for your database
|
||||
- ✅ Install composer dependencies
|
||||
- ✅ Build and start Docker containers
|
||||
- ✅ Run migrations
|
||||
- ✅ Create admin user (admin@example.com / password)
|
||||
|
||||
**Everything is pre-installed:**
|
||||
- ✅ Laravel 11 with Breeze authentication
|
||||
- ✅ Filament admin panel with user management
|
||||
- ✅ Pest testing framework
|
||||
- ✅ Laravel Pint code style
|
||||
- ✅ Queue workers & scheduler (optional)
|
||||
|
||||
**Access your app:**
|
||||
- Laravel App: http://localhost:8080
|
||||
- Admin Panel: http://localhost:8080/admin
|
||||
- Mailpit: http://localhost:8025
|
||||
|
||||
**Admin Login:**
|
||||
- Email: admin@example.com
|
||||
- Password: password
|
||||
|
||||
### Manual Setup (Alternative)
|
||||
|
||||
If you prefer manual control:
|
||||
|
||||
1. **Clone and configure**
|
||||
```bash
|
||||
git clone <repo-url> my-laravel-app
|
||||
cd my-laravel-app
|
||||
```
|
||||
|
||||
2. **Copy environment file**
|
||||
2. **Build containers**
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
3. **Install Laravel with your preferred database**
|
||||
```bash
|
||||
# With MySQL (default)
|
||||
make install DB=mysql
|
||||
|
||||
# With PostgreSQL
|
||||
make install DB=pgsql
|
||||
|
||||
# With SQLite
|
||||
make install DB=sqlite
|
||||
|
||||
# Or without Make:
|
||||
docker-compose build
|
||||
docker-compose --profile mysql run --rm app composer create-project laravel/laravel .
|
||||
cp src/.env.mysql src/.env
|
||||
```
|
||||
|
||||
4. **Start the development environment**
|
||||
3. **Install Laravel**
|
||||
```bash
|
||||
# Start with your chosen database
|
||||
make up DB=mysql # or pgsql, sqlite
|
||||
|
||||
# Or: docker-compose --profile mysql up -d
|
||||
docker-compose --profile mysql run --rm app composer create-project laravel/laravel:^11.0 /tmp/new
|
||||
docker-compose --profile mysql run --rm app sh -c "cp -r /tmp/new/. /var/www/html/ && rm -rf /tmp/new"
|
||||
```
|
||||
|
||||
5. **Access your application**
|
||||
- Laravel App: http://localhost:8080
|
||||
- Mailpit: http://localhost:8025
|
||||
|
||||
6. **Run setup scripts**
|
||||
4. **Configure environment**
|
||||
```bash
|
||||
# Install Flare, Pint, error pages
|
||||
make setup-tools
|
||||
|
||||
# Configure auth, API, middleware (interactive)
|
||||
make setup-laravel
|
||||
|
||||
# Or run both
|
||||
make setup-all
|
||||
cp src/.env.mysql src/.env # For MySQL
|
||||
# OR
|
||||
cp src/.env.pgsql src/.env # For PostgreSQL
|
||||
# OR
|
||||
cp src/.env.sqlite src/.env # For SQLite
|
||||
```
|
||||
|
||||
5. **Start containers**
|
||||
```bash
|
||||
docker-compose --profile mysql up -d
|
||||
```
|
||||
|
||||
6. **Run migrations**
|
||||
```bash
|
||||
docker-compose exec app php artisan migrate --force
|
||||
```
|
||||
|
||||
7. **Run setup scripts (optional)**
|
||||
```bash
|
||||
docker-compose exec app bash scripts/laravel-setup.sh
|
||||
```
|
||||
|
||||
### Common Commands
|
||||
|
||||
Reference in New Issue
Block a user