How to build a Laravel Library Borrowing and Penalty System with authentication, borrowing, and penalty modules

6 hours ago 1
ARTICLE AD BOX

The system uses:

Laravel Breeze Authentication

MVC Architecture

MySQL Database

Blade Templates

Modules:

Login Module

Book Management

Borrowing and Return Management

Penalty Management

Features

Book Management

Add/Edit/Delete books

Store:

title

author

category

available copies

Borrowing Module

Select member

Select book

Borrow date and due date

Return date

Borrow status (Borrowed, Returned, Overdue)

Penalty Module

Compute penalties for overdue books

Mark penalties as Paid/Unpaid

So my questions are what is the best database structure is for the books, borrowings, penalties, and members tables. I'm also unsure about the proper Eloquent relationships between Book and Borrowing, Member and Borrowing, and Borrowing and Penalty. For the penalty feature, what is the recommended way to compute overdue penalties in Laravel should the logic be placed inside the controller, a model accessor, or a separate service class? Additionally, should the borrowing status automatically update when the due date passes? Lastly, is it better to store the available_copies value directly in the books table, or should it be dynamically computed from borrowing records?

Read Entire Article