🎯 Learning Objectives
- Define project requirements
- Design database schema
- Plan application structure
- Create project roadmap
- Set up Laravel project
📋 Project Overview
Student Management System - A complete CRUD application where administrators can manage students, courses, and enrollments.
Tech Stack: Laravel 10, MySQL, Bootstrap 5, Blade Templates
✨ Project Features
👨🎓 Student Management
- Add new students
- View all students
- Update student information
- Delete students
- Search students
📚 Course Management
- Create courses
- List all courses
- Update course details
- Delete courses
- View enrolled students
📝 Enrollment System
- Enroll students in courses
- View enrollments
- Unenroll students
- Track enrollment dates
📊 Dashboard & Reports
- Total students count
- Total courses count
- Recent enrollments
- Statistics overview
🗄️ Database Schema
Students Table
| Column | Type | Constraints |
|---|---|---|
| id | bigint | PRIMARY KEY, AUTO_INCREMENT |
| name | varchar(100) | NOT NULL |
| varchar(100) | UNIQUE, NOT NULL | |
| phone | varchar(20) | NOT NULL |
| date_of_birth | date | NULL |
| address | text | NULL |
| created_at | timestamp | |
| updated_at | timestamp |
Courses Table
| Column | Type | Constraints |
|---|---|---|
| id | bigint | PRIMARY KEY, AUTO_INCREMENT |
| name | varchar(100) | NOT NULL |
| code | varchar(20) | UNIQUE, NOT NULL |
| description | text | NULL |
| duration_weeks | integer | NOT NULL |
| created_at | timestamp | |
| updated_at | timestamp |
Course_Student Table (Pivot)
| Column | Type | Constraints |
|---|---|---|
| id | bigint | PRIMARY KEY, AUTO_INCREMENT |
| student_id | bigint | FOREIGN KEY → students(id) |
| course_id | bigint | FOREIGN KEY → courses(id) |
| enrolled_at | timestamp | NULL |
📁 Project Structure
student-management/
│
├── app/
│ ├── Http/
│ │ └── Controllers/
│ │ ├── StudentController.php
│ │ ├── CourseController.php
│ │ ├── EnrollmentController.php
│ │ └── DashboardController.php
│ │
│ └── Models/
│ ├── Student.php
│ ├── Course.php
│ └── Enrollment.php (if separate table)
│
├── database/
│ └── migrations/
│ ├── xxxx_create_students_table.php
│ ├── xxxx_create_courses_table.php
│ └── xxxx_create_course_student_table.php
│
├── resources/
│ └── views/
│ ├── layouts/
│ │ └── app.blade.php
│ │
│ ├── dashboard/
│ │ └── index.blade.php
│ │
│ ├── students/
│ │ ├── index.blade.php
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ └── show.blade.php
│ │
│ ├── courses/
│ │ ├── index.blade.php
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ └── show.blade.php
│ │
│ └── enrollments/
│ ├── create.blade.php
│ └── index.blade.php
│
├── routes/
│ └── web.php
│
└── public/
├── css/
└── js/
🛠️ Project Setup Steps
Step 1: Create Laravel Project
# Create new Laravel project
composer create-project laravel/laravel student-management
# Or using Laravel installer
laravel new student-management
cd student-management
Step 2: Configure Database
# 1. Create database in phpMyAdmin
# Database name: student_management
# Collation: utf8mb4_unicode_ci
# 2. Update .env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=student_management
DB_USERNAME=root
DB_PASSWORD=
Step 3: Create Models & Migrations
# Create Student model with migration
php artisan make:model Student -m
# Create Course model with migration
php artisan make:model Course -m
# Create pivot table migration
php artisan make:migration create_course_student_table
Step 4: Create Controllers
# Create resource controllers
php artisan make:controller StudentController --resource
php artisan make:controller CourseController --resource
php artisan make:controller EnrollmentController
php artisan make:controller DashboardController
🎨 UI Design Plan
Color Scheme:
- Primary: #007bff (Blue)
- Success: #28a745 (Green)
- Danger: #dc3545 (Red)
- Info: #17a2b8 (Cyan)
Layout Components:
- Navigation bar with logo and menu
- Sidebar for dashboard navigation
- Content area with cards
- Footer with copyright
- Bootstrap 5 for responsive design
📝 Routes Planning
<?php
// routes/web.php
use App\Http\Controllers\StudentController;
use App\Http\Controllers\CourseController;
use App\Http\Controllers\EnrollmentController;
use App\Http\Controllers\DashboardController;
// Dashboard
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
// Students CRUD
Route::resource('students', StudentController::class);
// Courses CRUD
Route::resource('courses', CourseController::class);
// Enrollments
Route::get('/enrollments', [EnrollmentController::class, 'index'])->name('enrollments.index');
Route::get('/enrollments/create', [EnrollmentController::class, 'create'])->name('enrollments.create');
Route::post('/enrollments', [EnrollmentController::class, 'store'])->name('enrollments.store');
Route::delete('/enrollments/{student}/{course}', [EnrollmentController::class, 'destroy'])->name('enrollments.destroy');
?>
📊 Development Timeline
| Day | Tasks | Deliverables |
|---|---|---|
| Day 1 (Today) | Planning, Setup, Database Design | Project structure, Migrations ready |
| Day 2 | Create & Read Operations | Add students, List students, View student |
| Day 3 | Update, Delete & Testing | Complete CRUD, Enrollments, Dashboard |
✏️ Today's Tasks
- Create new Laravel project: student-management
- Set up database connection in .env
- Create Student, Course models with migrations
- Create pivot table migration
- Create all necessary controllers
- Plan routes in web.php
- Create basic layout template
✅ Today's Deliverable
- ✓ Project created and configured
- ✓ Database connected
- ✓ All migrations created
- ✓ Models configured with relationships
- ✓ Controllers generated
- ✓ Routes defined
- ✓ Project structure complete