Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AbdulBazith's avatar

confusion in Db structure for fees in school project laravel

i am working with school management system. i need to structure fee for students

my fee structure possess

Monthly fees (should pain monthy assingned to each class)

Term Fees (paid 3 months once assigned to each class )

Other fees (like uniform, id card, shoes shocks etc) not based on class

Tranport fee (assigned to student not class)

iam so confused about structuring this

classDetails table

id  name    desc
1   Vstd    -
2   VIstd   -
3   VIIstd  -

month fee is like lab fee should be paid monthly for each class so the columns are

id  name        class   fee-amt startdate   enddate     note
1   com.lab     1       2000    1/8/2020    15/8/2020   -
2   phy.lab     2       4000    1/8/2020    15/8/2020   -
3   chem.lab    3       8000    1/8/2020    15/8/2020   -

TermFee this is paidterm wise and assingned to each class. this is compulsory for all students. when choosing a student to pay the pay based on his class this must be fetched

id  name    class_id    fee-amt startdate   enddate     note
1   Term1       1       1000    1/8/2020    15/8/2020   -
2   Term2       1       15000    1/8/2020    15/8/2020   -
3   Term1       2       15000    1/8/2020    15/8/2020   -
3   Term2       2       2000    1/8/2020    15/8/2020   -

Other Fees this is not fixed for student or class. if a student asks shoes then that will be added to him else no

id  name                no's    amt     note
1   boy suniform        1       500     -
1   gir lssuniform      1       1000     -
1   id card             1       50      -
1   boys shoes          1       2000      -
1   girls shoes         1       2000     -

Tranport fee

id     name                 feeamt      note
1     school-location1      1000        -
2     school-location2      2000        -
3     school-location3      3000        -
4     school-location4      4000        -

So when i click a student of V std to pay the fee it shuld fetch the term fee based on that class and month fee based on that class and i have a button to add other fee if need.

how should i structure the db??

simply to say i cant differentiate between monthly fee and TermFee. if i click in june month for that term fee will be allocated soterm fee and that month fee should be fetched. if i click in july month for that only monthly fee should be come. becoz for that termfee not there.

here how i can structure the fee structure table and fee payment table???? kindly some one help please..

will polymorphic table work for this??

or else kindly share any link please..

0 likes
1 reply

Please or to participate in this conversation.