Recommended project structure
As the PHP application grows, it is helpful to keep database changes separate from application logic. A clean structure could look like this:
text
your-project/
│
├── database/
│ ├── migrations/
│ │ ├── 001_create_students.sql
│ │ ├── 002_create_books.sql
│ │ ├── 003_create_borrow.sql
│ │ └── 004_seed_data.sql
│ │
│ └── README.md
│
├── app/
│ ├── config/
│ │ └── database.php
│ │
│ ├── repositories/
│ │ ├── StudentRepository.php
│ │ ├── BookRepository.php
│ │ └── BorrowRepository.php
│ │
│ ├── services/
│ │ ├── StudentService.php
│ │ ├── BookService.php
│ │ └── BorrowService.php
│ │
│ └── ...
│
└── index.php
Sign in to save your progress permanently.
Progress is saved in your browser session
Step 18 of 19