Aviation Web Learning Lab
EN / ID
Theme

Module 2 - Day 1 of 5

Gemini CLI

Day 1: Laravel Project Setup

Welcome to Module 2 -- the Laravel Build! You have completed your PRD in Module 1, just like a pilot files a flight plan before flying. Now it is time to build the actual aircraft. Over the next 5 days, you will use Gemini CLI to help you build a working Laravel web application -- an Aircraft Maintenance Log system -- one small step at a time. Today is Day 1, and just like a pre-flight walkaround before a flight, we start by making sure your tools are ready. You will verify that PHP and Composer are installed on your computer, create a brand new Laravel project, configure a simple SQLite database, run the development server, and learn your way around the Laravel folder structure. By the end of today, your Laravel project will be running in your browser at localhost:8000. Important reminder: this project is for learning software development only. It is not a real aircraft maintenance system and must not be used for actual maintenance record-keeping.

Step 1

Verify that PHP and Composer are installed on your computer

Concept

Before every flight, a pilot does a pre-flight walkaround to check that all systems are working. Before building a Laravel application, you need to verify that the required tools are installed on your computer. The two tools you need are PHP (the programming language Laravel uses) and Composer (the package manager that installs Laravel). Without these, nothing else will work -- like trying to start an aircraft without fuel.

Apply

Open your terminal (Command Prompt on Windows, Terminal on Mac/Linux). Type the command to check your PHP version, then the command to check your Composer version. You need PHP 8.2 or higher and Composer 2.x.

Prompt

I am setting up my computer for Laravel development. Please tell me the terminal commands to check: 1. What version of PHP is installed (or if it is not installed) 2. What version of Composer is installed (or if it is not installed) I need PHP 8.2 or higher and Composer 2.x. Please also tell me: - If PHP is not installed, where to download it - If Composer is not installed, where to download it Keep the answer simple with just the commands and download URLs.

Expected Result

Your terminal should show PHP version 8.2 or higher (e.g., "PHP 8.2.x") and Composer version 2.x (e.g., "Composer version 2.x.x"). If either is missing or the version is too old, install or update it before proceeding.

Troubleshooting

  • • If the terminal says "php: command not found" or "composer: command not found", the tool is not installed. Download PHP from php.net and Composer from getcomposer.org. Follow the official installation instructions for your operating system.
  • • If your PHP version is below 8.2, you need to update PHP. Laravel 12 requires PHP 8.2 as a minimum. Check the official PHP website for the latest version for your operating system.
Step 2

Create a new Laravel project using Composer

Concept

When an airline adds a new aircraft to its fleet, the aircraft arrives with all its systems pre-installed -- engines, avionics, landing gear. Creating a new Laravel project is similar: Composer downloads a complete "aircraft" with all the framework files pre-configured. You do not build Laravel from scratch -- you download the entire framework and then customize it for your needs.

Apply

In your terminal, navigate to the folder where you want to create your project. Then run the Composer command to create a new Laravel project named "aircraft-maintenance-log".

Prompt

I want to create a new Laravel 12 project. Please give me the exact Composer command to create a new Laravel project named "aircraft-maintenance-log". The command should use composer create-project and target laravel/laravel. Show me the exact command I should copy and paste into my terminal.

Expected Result

After running the command, you should see Composer downloading packages. When it finishes, a new folder called "aircraft-maintenance-log" exists with Laravel files inside it. The download may take a few minutes depending on your internet speed.

Troubleshooting

  • • If you see "Could not find package laravel/laravel", make sure you have an internet connection and Composer is up to date. Run "composer self-update" then try again.
  • • If the download is very slow, you can try running "composer config -g repo.packagist composer https://packagist.org" to use the default Packagist mirror, then retry the create-project command.
Step 3

Configure SQLite as your database

Concept

SQLite is like a personal flight logbook -- small, self-contained, and always ready to use. Unlike MySQL or PostgreSQL which need a separate database server running, SQLite stores everything in a single file. For a learning project, this is perfect: zero configuration, no server to manage, and your data lives in one file called database.sqlite. Think of it as carrying your logbook in your flight bag instead of storing it in a separate records room.

Apply

Open the file .env inside your project folder. Find the database configuration section and change DB_CONNECTION to sqlite. Then create an empty database file at database/database.sqlite.

Prompt

I have a new Laravel project called "aircraft-maintenance-log". I need to configure it to use SQLite instead of MySQL. Please tell me: 1. What line to change in the .env file (show the exact line before and after) 2. The terminal command to create the empty SQLite database file at database/database.sqlite Show me the exact steps I should follow. I am a complete beginner.

Expected Result

The .env file should have DB_CONNECTION=sqlite (instead of DB_CONNECTION=mysql). An empty file named database.sqlite should exist in the database/ folder. You can verify by listing the files in the database/ directory.

Troubleshooting

  • • If you cannot find the .env file, look for a file called ".env.example" in the project root. Copy it to ".env" -- Laravel uses .env for configuration. Run "cp .env.example .env" (Mac/Linux) or "copy .env.example .env" (Windows).
  • • If the database.sqlite file is not created, make sure you are in the project directory first. Run "cd aircraft-maintenance-log" then "touch database/database.sqlite" (Mac/Linux) or "type nul > database\database.sqlite" (Windows).
Step 4

Run the Laravel development server

Concept

Artisan is Laravel's command-line tool -- like the ground power unit that starts an aircraft's systems on the ground. One of Artisan's most useful commands is "serve", which starts a local development server so you can see your application in the browser. This server is only for development -- like ground power is only used when the aircraft is on the ground, not in the air.

Apply

In your terminal, make sure you are inside the aircraft-maintenance-log project folder. Then run the Artisan serve command. Open your browser and visit the URL shown in the terminal.

Prompt

I have created a new Laravel project and configured SQLite. Now I need to start the development server. Please give me the exact Artisan command to start the Laravel development server. Also tell me what URL to open in my browser to see the Laravel welcome page.

Expected Result

Your terminal should show "Starting Laravel development server: http://127.0.0.1:8000". When you open http://localhost:8000 in your browser, you should see the Laravel welcome page with the Laravel logo and a message like "Your application is running."

Troubleshooting

  • • If you see "Artisan command not found" or "php artisan: command not found", make sure you are inside the project folder. Run "cd aircraft-maintenance-log" first, then try "php artisan serve" again.
  • • If port 8000 is already in use, you can specify a different port: "php artisan serve --port=8080". Then visit http://localhost:8080 in your browser instead.
Step 5

Understand the Laravel folder structure

Concept

When you enter a new hangar for the first time, you need to learn where everything is: where the tools are stored, where the parts inventory is kept, where the workstations are. The Laravel project has a similar layout -- each folder has a specific purpose. Understanding this layout now will save you time later because you will know exactly where to find and create files.

Apply

Ask Gemini to explain the key folders in a Laravel project. Focus on the four most important folders you will use in this course: app/, routes/, resources/views/, and database/.

Prompt

I just created my first Laravel project. Please explain the purpose of these 4 key folders in a simple way: 1. app/ -- what goes here? 2. routes/ -- what goes here? 3. resources/views/ -- what goes here? 4. database/ -- what goes here? Use 1-2 simple sentences for each. I am a complete beginner and do not know any programming terms yet.

Expected Result

You should understand that: app/ contains your PHP classes (Models and Controllers), routes/ defines which URLs your app responds to, resources/views/ contains your HTML Blade templates, and database/ contains migrations that define your database tables.

Troubleshooting

  • • You do not need to memorize every folder. Focus on these 4 folders: app/, routes/, resources/views/, and database/. These are the only folders you will modify during this course.
  • • If the explanation includes many technical terms you do not understand, ask Gemini: "Please simplify that. Use everyday words, not programming terms."
Step 6

Explore key configuration files

Concept

Every aircraft has an operating manual that explains the aircraft's settings, limits, and configuration. Your Laravel project has similar configuration files. The three most important files are: .env (environment settings like database connection), config/database.php (detailed database configuration), and routes/web.php (defines your app's URLs). Understanding these files is like reading the aircraft operating manual -- you know where to look when something needs adjusting.

Apply

Ask Gemini to explain what each of these three files does: .env, config/database.php, and routes/web.php. Then open each file in your text editor and briefly look at its contents.

Prompt

I am learning Laravel and want to understand 3 important configuration files. Please explain in simple terms: 1. .env -- what is this file for? What settings does it control? 2. config/database.php -- what is this file for? Do I need to edit it? 3. routes/web.php -- what is this file for? What does it do? Keep each explanation to 2-3 simple sentences. I am a beginner.

Expected Result

You should understand that: .env stores environment-specific settings (like database type and app name), config/database.php defines how Laravel connects to different database types (you do not need to edit this), and routes/web.php maps URLs to controller actions (you will edit this in Day 3).

Troubleshooting

  • • If you accidentally modify config/database.php or other config files, you can restore them from your git commit. This is why we commit early -- it is your safety net.
  • • Never share your .env file publicly -- it may contain sensitive information. When using git, the .env file is automatically ignored (listed in .gitignore) so it will not be uploaded.

Safety Warning

Before running any terminal command, make sure you understand what it does. Only use the official Laravel installer (composer create-project laravel/laravel). Never run commands from untrusted sources. If a command asks for your password or system permissions, stop and ask your instructor. This project is for learning purposes only -- it is not a real aircraft maintenance system.

Git Checkpoint

Run these commands to save your Day 1 progress. First, initialize git in your project folder, then commit all files: git init git add . git commit -m "Day 1: Laravel project created with SQLite configured" This creates your first safety checkpoint. If anything goes wrong later, you can always return to this point.

Self-Check

Quiz