|
| 1 | +# Laravel Template for GitHub Codespaces |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +A ready-to-use Laravel development environment, optimized for GitHub Codespaces. |
| 6 | +This template provides a seamless, zero-setup experience for Laravel development |
| 7 | +in the cloud. |
| 8 | + |
| 9 | +## Dev Container Config Overview |
| 10 | + |
| 11 | +- **Pre-configured Dev Container**: Uses Docker Compose to orchestrate PHP 8.2 |
| 12 | + (LTS), Node.js 18 (LTS), and MySQL 8.0 (LTS) services. |
| 13 | +- **MySQL Pre-installed and Running**: MySQL 8.0 is included as a service in the |
| 14 | + dev container—no need to install or configure a database server manually. |
| 15 | +- **VS Code Extensions**: Installs recommended extensions for Laravel, PHP, and |
| 16 | + Docker development. |
| 17 | +- **Automated Setup**: Handles dependency installation, environment setup, and |
| 18 | + database migrations automatically on first launch. |
| 19 | +- **Correct Permissions**: Ensures storage and cache directories are writable for |
| 20 | + Laravel. |
| 21 | + |
| 22 | +## Laravel Standard Installation |
| 23 | + |
| 24 | +- **Laravel Version**: 12.19.3 (latest as of July 2025) |
| 25 | +- **Standard Structure**: Includes all default Laravel directories and files |
| 26 | + (`app/`, `config/`, `database/`, `routes/`, etc.) |
| 27 | +- **No Custom Packages**: Clean install, ready for your customization. |
| 28 | + |
| 29 | +## Out-of-the-Box Features |
| 30 | + |
| 31 | +- **Automated Dependency Installation**: Runs `composer install` and |
| 32 | + `npm install` on first start. |
| 33 | +- **Automatic `.env` Setup**: Copies `.env.example` to `.env` and configures |
| 34 | + database credentials for the Codespace environment. |
| 35 | +- **Database Prepared Automatically**: The MySQL database is created, ready, and |
| 36 | + all migrations are run for you—no manual steps needed. |
| 37 | +- **Pre-installed VS Code Extensions**: Includes extensions for Blade, PHP |
| 38 | + Intelephense, Laravel snippets, and more. |
| 39 | +- **Writable Storage/Cache**: Ensures `storage/` and `bootstrap/cache/` are |
| 40 | + writable by the application. |
| 41 | + |
| 42 | +## Getting Started in Codespaces |
| 43 | + |
| 44 | +1. You can get started with this template in several ways: |
| 45 | + - **Open a Codespace directly from GitHub:** |
| 46 | + - If this repository is public, you can click the "Code" button on the |
| 47 | + repo page and select "Create codespace on main" (or another branch). |
| 48 | + No need to fork or clone first — GitHub will automatically provision a |
| 49 | + Codespace with the repo contents and devcontainer setup. |
| 50 | + - **Fork the repository:** |
| 51 | + - If you want your own copy of the repository (for making changes or |
| 52 | + keeping your own Codespace), fork it on GitHub, then open a Codespace |
| 53 | + from your fork. |
| 54 | + - **Manual setup using the devcontainer:** |
| 55 | + - You may also copy the `.devcontainer` folder/configuration to another |
| 56 | + project or environment to reuse the same development setup. This is |
| 57 | + only recommended if you know what you are doing — your project may not |
| 58 | + work at all if the environment is not compatible or is missing |
| 59 | + required services. |
| 60 | + |
| 61 | +2. **Wait for Setup**: The container will build, dependencies will be installed, |
| 62 | + and the database will be prepared automatically. As soon as the Codespace is |
| 63 | + available, you can open the `setup-status.log` file in the project root to |
| 64 | + watch the automated setup progress and verify it completed successfully. |
| 65 | +3. **Start the Laravel Development Server**: Run the following command in the |
| 66 | + terminal to start the app and make it accessible: |
| 67 | + |
| 68 | + ```bash |
| 69 | + php artisan serve --host=0.0.0.0 --port=8000 |
| 70 | + ``` |
| 71 | +4. **Open in Browser**: Once the app is running, a pop-up may appear in |
| 72 | + Codespaces with an "Open in Browser" button for port 8000. If you miss it, |
| 73 | + you can always go to the "Ports" tab, find port 8000, and click "Open in |
| 74 | + Browser". (The URL will be a Codespaces-specific address, not localhost.) |
| 75 | + |
| 76 | +## License |
| 77 | + |
| 78 | +This template is provided under the MIT License. See [LICENSE](LICENSE) for |
| 79 | +full details. |
0 commit comments