AbdulBazith

AbdulBazith

Member Since 1 Year Ago

India, Tamil Nadu, Tirunelveli

Experience Points
17,780
Total
Experience

2,220 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
7
Lessons
Completed
Best Reply Awards
2
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 4
17,780 XP
Dec
12
23 hours ago
Activity icon

Replied to Error In Student Mark DB Structure Insert And View

@snapey

I think after long gap iam tagging you. Kindly suggest your idea please.

just need to enter student mark.

the tables already have are ClassTable, UserTable,ExamTable,SubjectTable these are the tables i have. how to mingle this and to have a mark table. please suggest me an idea please.

Dec
11
1 day ago
Activity icon

Started a new Conversation Error In Student Mark DB Structure Insert And View

Guys iam working with a project School Management System

I have a small problem in entering marks of the student for specific class.

i have a form to add the student mark. first need to choose the class , section which subject(Eg: English), and which Exam (Eg: Quarterly exam). for that whole class english mark for quarterly exam is entered. now the problem is in db. how to frame the structure.

i have the following tables

SubjectDetails with columns (which has Subject details. just shown few columns only)

id      subjectcode     subjectName
1       SB01            English
2       SB02            Maths
.
.
.

ExamDetails with columns (which has Exam details. just shown few columns only)

id      Examcode        examName
1       Ex01            Quarterly Exam
2       Ex02            Halfyearly Exam

User with columns (which has student details. just shown few columns only)

id  user_name   class   section
1   Abdul       V       A
2   Bazith      V       A
3   Imran       V       A
4   Muthu       V       A

Now i need to mingle the above three tables and to have a new table to enter the student marks. how to do that, thats my question

what i did is had two tables

MainMark with columns

id  class_id    section_id  exam_id
1   V       A           1

SubMark with columns

id  mainmark_id     student_id  subject_id  Mark
1       1           1           1           80
2       1           2           1           90
3       1           3           1           75
4       1           4           1           60      

In the above table student_id and mark is changing. here for the same exam same class, same section i have entered the marks. so i given (exam, class, section) in mainmark table and for different student for different subject their mark changes so i given that in Submark table.

But fetching is the big issue for me. i think i done wrong some where. i cant predict it. kindly someone suggest your suggestion please.

The output i expect is when i choose a class and section and the exam, the student name with subject and marks must be displayed. this what i expect. Kindly some one help

Nov
28
2 weeks ago
Activity icon

Replied to Suggestion For Many To Many Relationship, And Data Repentance Laravel

@jeffreyvanrossum @bugsysha thank you guys thank you for your response.

Ya i know that post and tags where we can use pivot table.

ok let me ask a simple doubt?

i have two tables,

ClassDetails with columns

id      class_Name
1       V std
2       VI std

SubjectDetails with columns

id      subcode     subname
1       S001        English
2       S002        Maths
3       S004        Science

Now a single class can have many subjects and a single subject corresponds to many class.

for this iam doing a pivot table, ClassDetails_SubjectDetails

id      class_id        subject_id
1       1           1
2       1           2
3       2           1

here is my doubt i need a column status= active or inactive for both subject and class, because, i have a column acc_year in all tables. this year there may be english subject. but for next academic year they may remove the subject. i cant delete it, because old sudent marks are there. so i will inactive it, so for next year it wont come, so where i should use this status?? in class table or subject table or pivot table??

after using all these if i need to retrieve the subjects which belongs to a specific class the how i can do that???

Kindly suggest your ideas

Nov
26
2 weeks ago
Activity icon

Replied to Generate Serial Number With Current Year And Last Id Automatically Laravel

@alanholmes and @rodrigo.pedra thank you so much guys for your response. I will try it and it and inform .

Kindly if possible please suggest an idea for the below thread please. facing a huge problem in that. for past 3 months. still in confusion state.

Link: https://laracasts.com/discuss/channels/laravel/suggestion-for-many-to-many-relationship-and-data-repentance-laravel

Kindly suggest your opinion please please

Activity icon

Started a new Conversation Suggestion For Many To Many Relationship, And Data Repentance Laravel

Guys i have a big doubt in my project.

still now i worked with one to many relation only in my projects. iam not too familiar with many to many relationship.

iam working with a school project. got too confused with fee module. need a suggestion

i need to frame the fee structure of the school.

this is my table strucutre : https://imgur.com/KxLpQWI

I have drawn the table in my note: https://imgur.com/rmJWDSK

i have drawn the unstructured table also: https://imgur.com/DD1CHud

the requirement is, each class posses different fee structure and each fee structure has sub categories say for example,

Class: V std 

Term1 (main category)

        Tution fee  -   5000
        Van Fee     -   2000
        Extra Curicular-    4000
        Total           11000

Class: X std 

Term1 (main category)

        Tution fee  -   2000
        Van Fee     -   2000
        Extra Curicular-    4000
        Total           8000

In the above example for class V std term1 fee is 11000 with its sub categories and for class X std term1 fee is 8000 with its sub categories.

So already i have a table ClassDetails with columns

id      class_name      note
1       I std           this is 1st std
2       IIstd           this is 2nd standard
.
.
.so on

Now for fee structure how to frame the table? i know i need to have two tables feeMainCategory and FeeSubCategory.

but i need to link class with Feemainctegory and feemaincategory with feesubcategory

For this how many intermediate tables i need to have? how to frame a table. just i made the tables without intermediate. working fine, but the data are repeated.

my feemaincateogy table must possess the following columns

id  year        class_id        feemainName     note    status  amt
1   2019            1           Term1           ..      active  6000
2   2020            2           Term1           ..      active  9000

my feesubcateogy table must possess the following columns

id  feemaincat_id       subcatname      amt     note        status  
1   1                   busfee          3000        ...     active
2   1                   extrafee            3000        ...     active
3   2                   bus             8000        ...     active
4   2                   tutionfee       1000        ...     active

How i can mingle this tables. in this status is important because based on year those details changes. say for example, in 2019 term1 is active. but in 2021 they will stop term1 and have a different name with different amount. so i need that tooo. even sometimes the same term1 will for next year the amount will be increased. how to update this all?? kindly suugest me with ideas please. got so confused with relationship of many. please suggest with example table or any other links also please? can i have a extra column in my intermediate table?? like this status??

i have already asked this question many times. but still confused. i have shorten the question in this thread. if doubts you can refer the below threads for this question please.

Refer:

https://laracasts.com/discuss/channels/laravel/problem-any-to-many-relationship-with-class-and-fees

https://laracasts.com/discuss/channels/guides/problem-in-fetching-records-from-db-need-suggestion-for-columns-in-table

Nov
25
2 weeks ago
Activity icon

Replied to Comparison Of Two Tables With A Name In Where Condition In Laravel

@rodrigo.pedra thank you thank you so much. it worked fine. i made small changes with if condition in my view and thats it.

thank youuu..

if possible kindly suggest your answer for this please

Link: https://laracasts.com/discuss/channels/laravel/generate-serial-number-with-current-year-and-last-id-automatically-laravel

Activity icon

Started a new Conversation Generate Serial Number With Current Year And Last Id Automatically Laravel

Guys iam working with a project. i have a small doubt,

i have a fee payment form. the bill number must be automatically generated. how to do that?

year + serial Number in this order i need the bill number.

say for example,

Bill19-20-01
Bill19-20-02
Bill19-20-03

Here ```Bill``` is predefiend texr ```19-20``` is year and ```01,02, 03``` are comes from the next id of that payment table. how to get that??

FeePayment is my model name and feepayment is my table name

even i have a drop down in all form. for accademic year.

AccademicYear my model name and accademicyear table name with columns

id      accname
1       2018-2019
2       2019-2020

How to get this?

Nov
22
2 weeks ago
Activity icon

Replied to Comparison Of Two Tables With A Name In Where Condition In Laravel

@rodrigo.pedra thank you thank you so much for your response.

i tried your code just editing like this, in my controller.

  $records = FeePayment::query()
                ->with(['feeStructure'])
                ->selectRaw('student_id, feeStructure, SUM(paid_amt + disc_amt - fine_amt) as paid')->where('student_id',74)
                ->groupBy([ 'student_id', 'fee_main_cat_id'])
                ->get()
                ->groupBy('student_id');

Everthing worked fine. i added disc_amount with that, because i have a column in my payment table. and i need a where condition for specifically mention the student so i added that also.

but i have a small problem, if student_id: 5 didnt pay any fee means it should return all the terms fees from feeStrucutre table?? and if a student paid only term1 fee, then the remaining terms fee and its amount should be displayed. so that i will have a link and i will click and pay that in the same payment table.

this is what the output when student:5 doesnt pay any fee means,

Term1 Balance 6000
Term2 Balance 8000
Term3 Balance 10000

Actually this shows the whole,  term and fee from feestrucutre table because this student didnt pay any fee. so i have a link by click the amt and it will redirect to payment page.

if the student paid only term1 partially that is , term1 fee is 6000, but he paid only 4000 means the output should be,

Term1 Balance 2000
Term2 Balance 8000
Term3 Balance 10000

How this comes is for term1 he paid 4000 so its balance is shown and remaining term2 and term3 he not paid a single amount, so it shown fully.

as per your query everything works fine, but it shows only when student pays the fee. because the query projects from FeePayment Table.

can you guide me to achieve my output. thank you.

i think i didnt confuse you.

Activity icon

Started a new Conversation Comparison Of Two Tables With A Name In Where Condition In Laravel

Guys i have a small error in my project. i have two tables

Table 1: fees_structure its model is FeeStructure with columns

id      Name        Amount
1       Term1       6000
2       Term2       8000
3       Term3       10000

Table 2: fees_payment its model is FeePayment with columns

id      feestrcutre_id      student_id      Amount
1           1               5               1000
2           1               5               1000
3           1               5               2000
4           2               5               4000
5           2               5               1000
6           3               5               2000
7           3               5               2000

See i have above two tables in first table feestructure i have the name and amount. in the second table feepayment i have paid the amt for each student. let the student_id be 5

Now whats my doubt is when i choose student 5 means, it should compare, both the tables, compare the payment done by the student with fees_structure table and should return the balance amount.

From the above two tables the output will be like this, student may pay the fee in installment. in the above payment table student id 5 had paid the Term1 fee in 3 installment, 1000,1000,2000 (Total : 4000). original term1 fee amount is 6000(fees_structure table) so (6000 - 4000 = 2000)

The output looks like below. it should compare for each term for that student and return the balance amount to be paid.

Student Id: 5

Term1   Balance     2000

Term2   Balance     3000

Term3   Balance     6000    

How this comparison is done??? i know that i need to use loop in controller for checking the condition. Kindly give me a suggestion for this please. if you give a hint i will catch it up.

if student_id and feestructure both given say for example, student_id:5 fee:Term1 means the comparison would be easy. but only student_id will be given and it should compare all the fee strucutre like term1,term2,term3.......

Kindly suggest me a solution...

Nov
01
1 month ago
Activity icon

Started a new Conversation Payment Of Amount In Installment. Save It In Db With Terms In Laravel?

Guys iam working with a school project.

Iam facing a small problem.

I have a fee payment module.

user chooses the class and section and student name. a form appears with the all fees which are entered in a fee category table. the below is fee category table refer: https://imgur.com/68yVSGo

id      name            amt
1       Term1           5000
2       Term2           7000
3       Term3           6000


so in the fee form all the above will be displayed with the amount. a user can pay all the three of the term fees or any one. i have a checkbox to make show and hide the terms. everthing is fine. i also have a textbox with fine amount and discount amount. so if a parent pays the all the three terms then the total will ne 18000 + (2000) fine amount = 2000. so a parent will pay the fee for that student,

this will be saved in table in the above format

Feepayment table : Refer: https://imgur.com/Q5nz9dB

id  student_id  bill_no date    feecat_id   fine_amt    paid_amt
1       1       BB1     01-11   1           2000            18000
2       1       BB1     01-11   2           2000            18000
3       1       BB1     01-11   3           2000            18000

actually student=1 paid total amount of 20000 (18000 term + 2000 fine) only. but he had paid the whole three terms so i repeated the data thrice in the table, is this right format??

because i have another problem. say for example

student 2 will pay only first term fee. so term1 fee will be just 5000. and he will not pay the whole fee. he will pay the amount in installment. today 2000 tomorrow 1000 day after tomorrow 1000. for term1 itself he is paying the fee three times. so that must also be recorded. so for these three payment bill will be different.

how i can save this??

another problem. student 3 will pay the first term fee half. he will pay the remaining amount in the second term.

so when choosing the student balance shown first and then term2 and term3 must be shown.

how this is possible?? comparison of fee payment table and fee categories table?

simply to say whaterver amount student paid it must be recorded. and another thing if he keeps any balance in any term it must be fetched in next term in the name "balance amount"

How please some one suggest please

Oct
30
1 month ago
Activity icon

Replied to Attendance Value Problem In Laravel

@tisuchi

i have set db and form for attendance. but iam facing a small problem in my view, can you help me please

Refer: https://laracasts.com/discuss/channels/laravel/attendance-report-from-row-wise-in-db-to-column-wise-in-blade-file-laravel

Activity icon

Replied to How To Make Dynamic Insertion Of Textbox In Table With Dynamic Rows

@playingfootball sorry for the delay response.

it works fine... there is a tab Online Demo. click that and check it

Activity icon

Replied to How Toretrive Staff_designation From One Child Table To Another Child Table With One Parent Table

@geowrge thank you for your response and sorry for my delay response.

is this the only solution. why iam asking this because. generally we may have many table like this with one parent table and more than child table. so when need to call from one child table to another is this only procedure there else is there any other method or query

Activity icon

Replied to Attendance Report From Row Wise In Db To Column Wise In Blade File Laravel

@bobbybouwmann thank you for your response and sorry for my delay.

i i got the data. but the data which i got is in right format or not?? i dont know that itself. as i already said. data are stored in row wise in db. but i need to display it in column wise.

which i mentioned above.

the functions which you sent i saw it. but i dont know which to use. can you guide me some what please. else in my end do i need to send any screenshot??

in db it was like this

id      staff_id        att-date        att_count       reason
1       1           10-10-19        1               
2       2           10-10-19        0                   
3       1           11-10-19        0.5
4       2           11-10-19        1

in my blade iam expecting like this

StaffName       10-10-19        11-10-19        .   .   .   .
1               1               0.5
2               0               1
.
.
.
.
.


this is my problem

Activity icon

Started a new Conversation Array Of Checkbox In Javascript As Well As Controller Hide Section Show Section And Manage It

Guys iam working with school project. i have a module fee section.

i have a problem with it, when admin chooses the class and section and student name the fees which are in fees table must be retrieved and displayed in the screen.

i have table feemaincategory and feesubcategory

feemaincategory table consist of columns and data like below

id      name        amt
1       term1       8000
2       term2       5000

feesubcategory table consist of columns and data like below

id  maincategory_id     name        amt

1       1               vanfee      4000
2       1               tutionfee   4000
3       2               uniformfee  2500
4       2               extrafee        2500

say for example,

when admin choose student name AbdulBazith then it must giive output like below screen shot

Refer: https://imgur.com/ID3Uk37

AbdulBaazith    AdminNo:001     class:V std


(checkboxname:fee_yes_no[])Term1

<section name=???>

                                vanfee      4000
                                tutionfee   4000    
                                total       8000 (textbox name: total_amt[])

</section>

(checkboxname:fee_yes_no[])Term1Term2

<section name=???>

                                informfee   2500
                                extrafee        2500    
                                total       5000  (textbox name: total_amt[])

</section>

Fine amt : 100 (textbox name:fine_amt)  discount:100 (textbox name: disc_amt)   

                                TotalFeeAmt: 13000 (total of total_fee_amt[] )


i think the above calculation you guys understood clearly. a parent can pay both the termfee or any one term fee. in foreach the maincategory and subcategory are displayed.

whats my doubt is if a parent likes to pay only Term1 fee then he will uncheck the term2 fee. when he unchecks the term2 fee then that section should be hided and its total_amt[] must be less from total_fee_amt.

So a parent can uncheck any of the termfee, so that that section must be hided and its total amount must not take to overall total.

my problem is checkbox, section, total_amt for these three how should i name it. i think by array format only but how?

i did like this two format checkbox name="fee_yes_no" or name="fee_yes_no[{{feemain->id}}]" like this?? which is correct and how to do that.

the calculation which i done is given below

<script>

  var disc_amt = +document.getElementById('disc_amt').value || "0";

  var fine_amt = +document.getElementById('fine_amt').value || "0";

 var total_amt= document.getElementsByName('tot_amt[]');

                        var total_fee_amt= document.getElementById('total_fee_amt');
                        total_fee_amt.value = 0;

                        var amt=0;

this for loop is used to add the total of each term that is ```total_amt[]```

  for (var i = 0; i < total_amt.length; i++) {

                            amt= amt+ parseFloat(total_amt[i].value) ;

                                }

then what iam doing is  need to add the fine amount and subtract the discount amount. that process done below

total_fee_amt.value = amt+ parseFloat(fine_amt) - parseFloat(disc_amt);

</script>


Everything is fine. Working good calculation etc are works correct.

But my issue is when i uncheck the checkbox that section should hide and that total_amt should be not taken for calculation. ho to do that???

I have given my form design below


this below code is  checkbox and displaying of term1 term2 so on

 <input name="fee_yes_no[{{ $fee->id }}]" id="fee_yes_no" type="checkbox" value="need_fee" onclick="testt();" checked>

<span class="cr cr-new"><i class="cr-icon icofont icofont-verification-check txt-primary"></i></span>
{{ $fee->fee_main_cat }} </label>


the below code is for display the sub categories with total_amt[]

 <section class="row col-md-12" id="fee_cons" name="fee_cons[]">
     <div class="card-block">
         <div class="col-lg-12 col-xl-12">
             <div class="table-responsive">
                 <div class="checkbox-fade fade-in-primary checkbox">
                     <input id="fee_main_cat_id" name="fee_main_cat_id" type="hidden" value="{{ $fee->id }}"
                         class="form-control required" aria-required="true" readonly>
                 </div>
                 <table class="table m-0 b-tp">
                     <tbody>
                         @foreach ($fee->feesubs as
                         $feesub )
                         <tr>
                             <th>{{ $feesub->fee_sub_cat }}
                             </th>
                             <td>
                                 <input id="fee_sub" name="fee_sub" type="text" class="form-control required"
                                     aria-required="true" value="{{ $feesub->amt }}" readonly>
                             </td>
                             @php
                             $total += $feesub->amt;
                             @endphp
                             @if($loop->last)
                             <th>Total Fee</th>
                             <td>
                                 <input id="total_amt" name="total_amt[]" type="text" class="form-control required"
                                     aria-required="true" readonly value="{{ $total }}">
                             </td>
                             @endif
                         </tr>
                         @endforeach
                     </tbody>
                 </table>
             </div>
         </div>
     </div>
 </section>

the same problem is my controller also. after doing it here in controller how i can do this to save in db

Oct
26
1 month ago
Activity icon

Replied to Update Laravel From 5.4 To Newer Version In Live

@siangboon @saadaan ya you both are right.

just i changed it into another location. than k you for your kind help. but i need to know how to upgrade laravel version when it is in live.

and if possible if you are free refer this also please.

Refer:

https://laracasts.com/discuss/channels/laravel/attendance-report-from-row-wise-in-db-to-column-wise-in-blade-file-laravel

refer:

https://laracasts.com/discuss/channels/laravel/how-toretrive-staff-designation-from-one-child-table-to-another-child-table-with-one-parent-table

Activity icon

Started a new Conversation How Toretrive Staff_designation From One Child Table To Another Child Table With One Parent Table

guys iam working with a school project.

i need to insert staff details so what i did is

i had a form which creates an account for staff and then other details in other table

users table below

id
user_name

official_info table

id
staff_id (fk from users table)
designation

here users in parent table and official_ info is child table

now i have another problem

i have an attendance table where columns are

id
staff_id (pk from users table)
att_date

now whats my problem when i display the attendance i need to display the staff_designation also.

for name i did like this

$attendance->staff->user_name   (as it is directly connected to user table)

but designation is in official_info table which is a child table then how?

simply to say user is parent table and attendance and official_info are child table. how can i access the official_table info by attendance table??

Kindly some one help please

my user model

 public function staffofficial()
     {
         return $this->hasOne('App\StaffOfficialInfo', 'staff_id');
     }

  public function staffattendance()
     {
         return $this->hasmany('App\StaffAttendance', 'staff_id');
     }


my staff attendance model

  public function staff()
    {
        return $this->belongsTo('App\User', 'staff_id');
    }



my official model

 public function user()
    {
        return $this->belongsTo('App\User', 'staff_id');
    }



Oct
25
1 month ago
Activity icon

Started a new Conversation Attendance Report From Row Wise In Db To Column Wise In Blade File Laravel

Guys iam working with a school project. i have tow attendance module. staff and student attendance.

but staff attendance is easy, so i worked with that but everthing is in my report how to show it thats the problem.

this how my attendance are store in db staff_attendance table

Refer: https://imgur.com/Zvjwkch


id      staff_id        att-date        att_count       reason
1       1           10-10-19        1               
2       2           10-10-19        0                   
3       1           11-10-19        0.5
4       2           11-10-19        1


here 1=present 0= absent 0.5 = halfday. the data area stored in row wise in table. for staff id 1 and 2 i have entered an attendance for two dates 10 and 11 october. here the records are in row wise

now what i expect in the report blade is

StaffName       10-10-19        11-10-19        .   .   .   .
1               1               0.5
2               0               1
.
.
.
.
.

here iam expecting the report in column wise

so i made a query like this with the help of @mstrauss .

  $attendances=StaffAttendance:: whereMonth('att_date' ,Carbon::parse($request->att_month)->month)->where('acc_year_id',$request->acc_year_id)->get()->groupBy('att_date');

and when i dd( $attendances)

Collection {#2036 ▼
  #items: array:6 [▼
    "2019-10-24" => Collection {#2030 ▶}
    "2019-10-25" => Collection {#2031 ▶}
    "2019-10-26" => Collection {#2032 ▶}
    "2019-10-27" => Collection {#2033 ▶}
    "2019-10-28" => Collection {#2034 ▶}
    "2019-10-29" => Collection {#2035 ▶}
  ]
}


when  i extend each date then

Collection {#2036 ▼
  #items: array:6 [▼
    "2019-10-24" => Collection {#2030 ▼
      #items: array:18 [▶]
    }
    "2019-10-25" => Collection {#2031 ▶}
    "2019-10-26" => Collection {#2032 ▶}
    "2019-10-27" => Collection {#2033 ▶}
    "2019-10-28" => Collection {#2034 ▶}
    "2019-10-29" => Collection {#2035 ▶}
  ]
}


when i extend the array 18 means

Collection {#2036 ▼
  #items: array:6 [▼
    "2019-10-24" => Collection {#2030 ▼
      #items: array:18 [▼
        0 => StaffAttendance {#1919 ▶}
        1 => StaffAttendance {#1920 ▶}
        2 => StaffAttendance {#1921 ▶}
        3 => StaffAttendance {#1922 ▶}
        4 => StaffAttendance {#1923 ▶}
        5 => StaffAttendance {#1924 ▶}
        6 => StaffAttendance {#1925 ▶}
        7 => StaffAttendance {#1926 ▶}
        8 => StaffAttendance {#1927 ▶}
        9 => StaffAttendance {#1928 ▶}
        10 => StaffAttendance {#1929 ▶}
        11 => StaffAttendance {#1930 ▶}
        12 => StaffAttendance {#1931 ▶}
        13 => StaffAttendance {#1932 ▶}
        14 => StaffAttendance {#1933 ▶}
        15 => StaffAttendance {#1934 ▶}
        16 => StaffAttendance {#1935 ▶}
        17 => StaffAttendance {#1936 ▶}
      ]
    }
    "2019-10-25" => Collection {#2031 ▶}
    "2019-10-26" => Collection {#2032 ▶}
    "2019-10-27" => Collection {#2033 ▶}
    "2019-10-28" => Collection {#2034 ▶}
    "2019-10-29" => Collection {#2035 ▶}
  ]
}



when i extend the staffAttendance array means

Collection {#2036 ▼
  #items: array:6 [▼
    "2019-10-24" => Collection {#2030 ▼
      #items: array:18 [▼
        0 => StaffAttendance {#1919 ▼
          #fillable: array:5 [ …5]
          #connection: "mysql"
          #table: "staff_attendances"
          #primaryKey: "id"
          #keyType: "int"
          +incrementing: true
          #with: []
          #withCount: []
          #perPage: 15
          +exists: true
          +wasRecentlyCreated: false
          #attributes: array:8 [ …8]
          #original: array:8 [ …8]
          #changes: []
          #casts: []
          #dates: []
          #dateFormat: null
          #appends: []
          #dispatchesEvents: []
          #observables: []
          #relations: []
          #touches: []
          +timestamps: true
          #hidden: []
          #visible: []
          #guarded: array:1 [ …1]
        }
        1 => StaffAttendance {#1920 ▶}
        2 => StaffAttendance {#1921 ▶}
        3 => StaffAttendance {#1922 ▶}
        4 => StaffAttendance {#1923 ▶}
        5 => StaffAttendance {#1924 ▶}
        6 => StaffAttendance {#1925 ▶}
        7 => StaffAttendance {#1926 ▶}
        8 => StaffAttendance {#1927 ▶}
        9 => StaffAttendance {#1928 ▶}
        10 => StaffAttendance {#1929 ▶}
        11 => StaffAttendance {#1930 ▶}
        12 => StaffAttendance {#1931 ▶}
        13 => StaffAttendance {#1932 ▶}
        14 => StaffAttendance {#1933 ▶}
        15 => StaffAttendance {#1934 ▶}
        16 => StaffAttendance {#1935 ▶}
        17 => StaffAttendance {#1936 ▶}
      ]
    }
    "2019-10-25" => Collection {#2031 ▶}
    "2019-10-26" => Collection {#2032 ▶}
    "2019-10-27" => Collection {#2033 ▶}
    "2019-10-28" => Collection {#2034 ▶}
    "2019-10-29" => Collection {#2035 ▶}
  ]
}

kindly some one help pleaseee

in my blade file i need to use two forloops like below

//this displayes the date in column wise like 10 11 12 like this

@foreach($attendances as $key => $attendance)
<th>{{ \Carbon\Carbon::parse( $key)->format('d') }}</th>
@endforeach

//this is for displaying the other data.

@foreach ($attendance as $value)

<tr>
    <td>{{ $loop->iteration }}</td>
    <td> {{ $value->staff->user_name}} </td>
    <td> {{ $value->att_count}} </td>

</tr>

@endforeach


But i cant get it everything is collapsing. what may be the problem. i know that tr td will be an issue. but cant get it.

did my fetch query is right?? else need to change there anything

Activity icon

Started a new Conversation Update Laravel From 5.4 To Newer Version In Live

Guys iam sticking into a problem.

i have a domain xyz.com in cpanel with version php 7.3 inherited.

i have two folders in that xyz.com.

that is xyz.com/hotel -> this is for my hotel project and xyz.com/school ->school project.

in this

xyz.com/hotel -> Laravel Framework 5.4.36 version


xyz.com/school   ->Laravel Framework 5.8.33 version


everything is fine. 2 days back i faced a problem. that images cant be uploaded in school project that is xyz.com/school in this. when i checked i saw the below error

Refer : https://imgur.com/im4ct1h

PHP Fileinfo extension must be installed/enabled to use Intervention Image

i refereed in google and i got the answer that to enable the fileinfo in cpanel. i dont have that updation in my cpanel. so chatted with my cpanel support and said them to enable the fileinfo. they made some changes in php.ini file and then informed me. now the site worked fine. images uploaded correctly.

but i faced another problem in my xyz.com/hotel project, because they changed the php version of that xyz.com to 7.3 version not inherited.

the problem i faced in xyz.com/hotel is

Refer: https://imgur.com/4uUHiY4

compact(): Undefined variable: operator


iam facing this problem when taking reports in the hotel project. but all other modules works fine. when i didnt use any comapct() variable or term related to compact in my report controller.

whats the problem????

when i googled it i found the solution that need to update laravel version more than 5.4. but how can i update my laravel version of my hotel project which is in live??

what should i do.?

when i asked my support the gave an explanation that

Now your application (xyz.com) works on 7.3 inherit
    
Now what inherit does is it takes default server values

Php 7.3 inherit takes the default settings of the server

And PHP 7.3 allows you to edit the values
So when you use 7.3 it takes the value I set in php.ini
Now if it takes the value from php.ini then your extension Fileinfo gets active
But your other website needs default configuration

So it starts to throw error
Now what you can do is.
When ever you want to upload the file
to your application.
Just temporarily change the PHP version
Upload the files
And then revert it back


the above is the explanation given by my support. i cant understand anything.

now what i thought is may be the hotel project is in lower version 5.4 so if we update that the compact error my vanish. is this right??

Kidny some one suggest an idea please.

Oct
14
1 month ago
Activity icon

Replied to Problem Many To Many Relationship With Class And Fees

@siangboon @michapietsch @mstrauss @Tray2 @aurawindsurfing @lostdreamer_nl @jlrdw

sorry guys for tagging you all. o one is replying so i need help please.

Kidly suggest any idea please in very confusion state

Oct
13
2 months ago
Activity icon

Replied to Problem Many To Many Relationship With Class And Fees

i have drawn the unstructured table also: https://imgur.com/DD1CHud

This is my unstructured table format. here class, fee main category, fee sub category amount all included. how i need to split it.

Kindly some one suugest please

Oct
12
2 months ago
Activity icon

Replied to Problem Many To Many Relationship With Class And Fees

@snapey a big sorry for tagging you sorry sorry.

any suggestions please????

Activity icon

Replied to Problem Many To Many Relationship With Class And Fees

I have drawn the table in my note: https://imgur.com/rmJWDSK

Kindly refer this and suggest your idea guys please.. how to relate these three tables.

a single class can have multiple main category and a single main category can have multiple class and a a single main category can have multiple sub category

Activity icon

Started a new Conversation Problem Many To Many Relationship With Class And Fees

Guys iam working with a project school management system.

I have to work with feePayment module.

The fee payment structure is left to the client to make their won structure of fee.

In all schools the fee structure would be like category wise. 1 main category and for that main category there will sub categories

how the process is done is

the school posses Main category and sub category of fee, like below structure


Term1     payment duration (1-08-2019 to 15-08-2019)
    school Fee =  6000
    Bus Fee   =  3000
    Tution Fee= 2500

Term 2  payment duration (1-12-2019 to 15-12-2019)
    school Fee = 6000
    Lab Fee   =   3000

Term3   payment duration (1-03-2020 to 15-08-2020)
    School Fee= 6000
    extra fee = 2000

like this it goes on,

here Term1, Term2 Term3 are main cateogries and school fee, extra fee tution fee are sub categories

this is my table strucutre : https://imgur.com/KxLpQWI

Whats my problem is

the below given are three tables. how can i link them with many to many or how kindly give some suggestion please. how to link these three tables

Feemaincategory         Feesub category         class

how this works is,

``` 5th std   -Term1  -> (tutionfee, bus fee) ```

``` 6th std -  Term1-> (tution fee, bus fee) ```

here class, fee main category, fee sub category are included. how i can insert these?? how i need to make the db kindly someone suggest please

Oct
11
2 months ago
Activity icon

Replied to Input Field

@ain You can use readonly attribute for this as per @szach answer.

that works fine.

Activity icon

Replied to Attendance Value Problem In Laravel

@tisuchi ya ya you are right. using calendar is good option.

But another question raises in my mind. if i need to use calendar means then i need any table for that. else direct calendar can be used as UI.

and local holidays are decided suddenly as small small reasons. there will be no calendar occurs in net for all these holidays. some times if heavy rains means then leave will be provided by the area government.

so these also to be stored in db am i right??

for this i need to link the calendar and attendance. but i can get any idea how to do that.

Oct
10
2 months ago
Activity icon

Replied to Attendance Value Problem In Laravel

@tisuchi thank you for your suggestion.

ya you are right keeping numeric values is a better choice. i planned to keep that only.

But my problem is if any local holidays festival holidays therewill be no attendance and no records in the db.

so in report those days will be not shown. but my client is expecting the the holidays also to be shown in the screen.

say for example : if any local holiday means the reason should be inserted. so in the report that date should be shown as leave with reason.

do you understand?? else i confused you??

Oct
08
2 months ago
Activity icon

Replied to How To Make A Single Form For Edit And Update And Also For Adding

@tisuchi thank you so much for your response.

and very sorry for delay.

actually what i did is i have

//MY models
Official info
personal info
Address Info
Parents Info
Siblings Info
Previous Education Info etc 

//My controllers

OfficialinfoController
personalfoController
AddressfoController
ParentsfoController
SiblingsfoController
Previous EducationfoController etc

so i have a single edit form with all the sections (page name: edit-all )

in my profile page when i click the edit icon of Official details it moves to the OfficialInfoController edit and then comes to the edit-all page there i had i checking condition @isset(variableName)

so when it comes to PersonalInfo then @isset($editpersonal) like this based on the variable present i used the edit-all page

but one mistake which i done is used form tags for each section inside that @isset condition

so if my sections are 6 then i have 6 form tags. but worked fine .

Thank you for your suggestion..

Activity icon

Started a new Conversation Attendance Value Problem In Laravel

Guys iam working with a project School Management system.

i have a module Attendance for staff and student.

this is my attendance form for student: https://imgur.com/tkX80ql

here all the student for specific class is displayed with the options present, absent and half day. by default present is checked. if any student absent or half day that is changed and to be inserted into db.

My doubt is how can i insert this into database.

in my old project hotel project for employee module what i done is had attendance table like below

id      att_date        emp_id          att_count       reason  
1       01-10-19        3               1               null
2       01-10-19        4               0               fever so absent
3       01-10-19        5               0.5             half day personal work

in the above table 0=absent 1=present 0.5=halfday

this worked fine for my old project.

but it comes to report i faced many problems. because when need to take total count days for 1 month for specific employee i faced problems.

so iam asking suggestion for this project. how can i use tables for storing the attendance.

i need a report like below

Student         1       2       3       4       5       total(dates of single month)

Abdul           p       A       H       p       p       3.5  
Bazith          p       p       p       p       p       5

in the above report p=present H=half day A=Absent

if any holidays comes like Saturday and Sunday it must also be shown in the report. because if any holidays that day attendance are not taken. so in report that date should be displayed with the reason for that holiday.

Kindly some one help pleaseee..

Sep
28
2 months ago
Activity icon

Started a new Conversation How To Make A Single Form For Edit And Update And Also For Adding

Guys iam working with a project School Management System.

i have a add form to add the student.

it is a single form which consist of more than 5 sections like

Official info
personal info
Address Info
Parents Info
Siblings Info
Previous Education Info etc

i have controller for each of them and model also for each of them.

the above mentioned are in a single from with different sections. in this official and personal info are mandatory fields remaining are optional.

when the school staff comes and add a student she will fill the personal and official info, whether she needs she will insert other details.

and i had a profile view form where it displays the student detail with section wise.

now what client expecting is in the profile page a have edit button for each section, if they click that only that portion must be in another page with editable then they can edit.

now whether i need to have that much edit forms and for each section???

and some times they may leave the address information when adding a student. so i have a add button also in the profile page. so when the client click that, only address form should open. like wise for other also,

so my doubt is whether i need to have that much edit and add forms??

is there any simple solution???

Sep
25
2 months ago
Activity icon

Replied to SQLSTATE[22003]: Numeric Value Out Of Range: 1264 Out Of Range Value For Column 'emp_mobile' At Row 1

@kanchan186 check your migration of employee table with the emp_mobile

it must be longInt

sorry sorry

it is

$table->bigInteger('emp_mobile');

for further details refer: https://laravel.com/docs/5.8/migrations

Activity icon

Replied to Sum The Product Quantity Of Same Product Id In Two Tables And Sum It Laravel

@snapey sorry once again, i tried like this

 $products=Product::with('OpenStock ','Purchase ','StockIssue ')->get();

actually the adding can be done in blade file. but the sum of same products must be done in controller itself, so how to write??

is this start right?

why iam asking is in my openstock what i did is just fetched the openstock table like this

$openingstocks =OpeningStock::where('hotel_id', Auth::user()->hotel_id)->orderBy('created_at', 'asc')->where('open_date', Carbon::today())->get();

and then need to fetch rate from purchase table

so did the coding like this which u gave

  $latestPrices = Purchase::where ('hotel_id',Auth::user()->hotel_id)->whereIn('id',
        DB::table('purchase')->where ('hotel_id',Auth::user()->hotel_id)
            ->selectRaw('max(id) as id')
            ->groupBy('product_id')
            ->pluck('id')
        )->get();

here no rate . just need to take the qty from all the three tables. but a condition that in purchase and Stockissue table there my more entries for same product_id, so for the it must sum the qty of same product id.

Kindly please help me

Sep
19
2 months ago
Activity icon

Replied to Sum The Product Quantity Of Same Product Id In Two Tables And Sum It Laravel

@snapey sorry, sorry sorry sorry.

but when no one responding, i feel bad. thats why tagging you. if some body just give any suggestion then i can move forward.

once again sorry sorry sorry sorry.

can you give any glimpses of coding please.

Sep
18
2 months ago
Activity icon

Replied to Sum The Product Quantity Of Same Product Id In Two Tables And Sum It Laravel

@snapey can u suggest me.

dont think that iam often tagging uu. sorry

Sep
17
2 months ago
Activity icon

Started a new Conversation Sum The Product Quantity Of Same Product Id In Two Tables And Sum It Laravel

Guys iam working with a project hotel management system.

i have three tables

Table 1: OpenStock with columns

id
open_date
product_id
opening_qty

// its respective model

 public function product()
    {
        return $this->belongsTo('App\Product', 'product_id');
    }

Table 2 : Purchase with columns

id
purchase_date
product_id
product_qty

//its respective model

 public function product()
    {
        return $this->belongsTo('App\Product', 'product_id');
    }

Table 3 :StockIssue with columns

id
product_id
issued_date
issued_qty

//its respective model

 public function product()
    {
        return $this->belongsTo('App\Product', 'product_id');
    }

My products table has columns

id
product_name

what i expect is need to fetch records from OpenStock table, Purchase table, and StockIssue table and add the quantity of same product_id (sum the OpenStock and Purchase) and subtract it from stockIssue table

this what the output i expect

product     openstock       purchasestock   totalstock  issuedstock balance

potato      10              20              30          2           28
tomato      12              20              32          30          2

iam expecting the output like above.kindly some one give idea please..

i was so confused that from where i should start the query. from product table or purchase table or openstock table or issued table.

i know that need to used joins. but whenever joins are involved iam so confused.

so kindly some one suggest ideas please

Activity icon

Started a new Conversation Package For Attendance Managing Laravel

Guys iam working with a project school management system.

i need to maintain the attendance of the students.

basically in my last application what i did is had a table for the employee with columns

id      emp_id      attendance_count        reason

1       1           1                       present
2       2           0                       fever so absent
3       3           0.5                     half day permission

1= present; 0= absent; 0.5= half day

i followed this in my last project. but in this school management system i need to make the festival holidays, etc etc.

so is there any package for maintaining the attendance.

Kindly someone suggest any package please.

need to maintain

holidays of Saturdays and Sundays

festival holidays etc in calendar format

Sep
12
3 months ago
Activity icon

Replied to Search Box In Multiple Select (array Of Select Box) Not Working

@lostdreamer_nl thank you thank you sooo much.

liked your reason for vacation. think had a good vacation.

ok let me try the code and intimate you ..

Sep
11
3 months ago
Activity icon

Replied to Suggestion For Tables Collision For Main Category And Sub Category Of Fee Payment

@michapietsch thank you thank you sooo much.

yes you are right. its better to have a checkbox or radiobutton.

ya having good knowledge in javascript so i can work through it.

if possible can you suggest me idea for this also please:

https://laracasts.com/discuss/channels/guides/problem-in-fetching-records-from-db-need-suggestion-for-columns-in-table

Sep
10
3 months ago
Activity icon

Replied to Problem In Fetching Records From Db. Need Suggestion For Columns In Table

@snapey just give your suggestion that's enough

I have finalized the table and given in the below image

Refer: https://imgur.com/E12vRGr

is this right?? do i need another table? if the parent kept a balance of 1000 rupees in the term1 means, it must be fetched in the term2. thats why i kept a text box old balance in the form.

is this right??

Sep
07
3 months ago
Activity icon

Replied to Problem In Fetching Records From Db. Need Suggestion For Columns In Table

@snapey

Sorry for tagging you, can you suggest any idea.

i thought all the possible ways and mentioned in this thread. getting some what confused.

Activity icon

Replied to Problem In Fetching Records From Db. Need Suggestion For Columns In Table

These are the columns to be saved after fee payment

acc_year_id (academic year)

class_id 

section_id

student_id

bill_no

payment_date

any_notes  (any notes can be written)

cash_type (fee paid by cash or cheque just the type can be mentioned)

discount_amt  (if any discount amount is given to that student)

fine_amt (if any fine )

balance_amt (some times parents may pay only 3/4th of the amt like if 10000 is there they will pay 8000 and keep the balance 2000 to pay in next term that is term2. like installment payment.)

fee_main_cat_id (the main category like term1 or term2)

fee_sub_cat_id (sub categories for the main category term1 bus fee, school fee, extra fee etc..)

tota_amt_of_fee_main_cat (the actual amt for the main category say like 10000 rupees)

payment_status (paid /or /not)


all the above columns i must save. my doubt is do i need all the above columns?? else shall i can remove few?? how i can make this in two tables or in a single table.

and i expect the output as like below. if the parent need the receipt as printed format the printed format should be like below

Term1
    School Fee      5000
    Bus Fee         2000
    Lab Fee         2000
    Extra fee       1000

        Total       10000


Term2 ...  (if the parent pay the term 2 fee also this will be filled same as term1)

// if the parent kept any balance means it should be given like below

Term1
    School Fee      5000
    Bus Fee         2000
    Lab Fee         2000
    Extra fee       1000

        Total       10000
        Paid          8000

        Balance       2000

and this balance is carried to next term fee that is for term2 fee. thats why i given a balance textbox in the fee payment form.

what i planned is dividing it in two tables

Table 1: Student_fee_transaction_master with columns

acc_year_id 

class_id 

section_id

student_id

bill_no

payment_date

any_notes 

cash_type 

Fees_original_amt 

discount_amt 

fine_amt 

balance_amt 

fee_main_cat_id 


Table 2: Student_fee_transaction_details with columns

id
bill_no_id (from master table)
fee_main_cat_id
fee_sub_cat_detail 

// this table fully says abt the fee sub category details


is all this right??

kindly some one hlep please??

Activity icon

Replied to Suggestion For Tables Collision For Main Category And Sub Category Of Fee Payment

@michapietsch

so that i can use a check box or radio button to have a textbox or dropdown.

Am i right??

Kindly if possible suggest me a solution for this question also please,

link: https://laracasts.com/discuss/channels/guides/problem-in-fetching-records-from-db-need-suggestion-for-columns-in-table

Sep
06
3 months ago
Activity icon

Started a new Conversation Problem In Fetching Records From Db. Need Suggestion For Columns In Table

Guys iam working with a project school management system.

i have completed 2 modules (student registration and sms panel)

Now started my 3rd module fee payment.

the fee payment takes two steps,

1)fee structure and 
2 )fee payment

In fee structure

the school posses Main category and sub category of fee, like below structure

Term1     payment duration (1-08-2019 to 15-08-2019)
    school Fee =  6000
    Bus Fee   =  3000
    Tution Fee= 2500

Term 2  payment duration (1-12-2019 to 15-12-2019)
    school Fee = 6000
    Lab Fee   =   3000

Term3   payment duration (1-03-2020 to 15-08-2020)
    School Fee= 6000
    extra fee = 2000

like this it goes on,

this structure may varies class wise (1 std 2nd std and so on...)

So for this i planned two tables to add the main category and the sub category.

here are the images

main category table: https://imgur.com/XO1B2le

sub category table: https://imgur.com/fNd9idT

so the fee structure is ready. every thing ok i think so.

Next lets move to Fee payment process

in fee payment form i have class(dropdown), section(dropdown), student name(dropdown).

when class is selected, its relevant section is selected and when section is selected the students of that section are listed. so when that specific student is selected, what i expect is the term1 and term2 that is from the fee main category, its name and its sub categories must be listed with amount to pay the fee for that student.

i have a form like this: https://imgur.com/mRqNVE6

when serach button is clicked this below portion in the image will be fetched from table. but my doubt is from which table the fee main caegory and sub category are fetched??? some student will keep the first term fee pending (few amt) and they will pay in second term. some will pay the whole fee in single slot itself.

When the year, class, section name are selected, the below portion must be rose with the tem1 and term2 info below.

my doubt is from which table it must be fetched. some students may pay the fee in a single slot for whole year, some student may pay the fee for that term. some student may pay the fee in installment. that is if termfee is 10000 means, 8000 they will pay, 2000 they will keep the balance, and they will pay in next term.

My doubt is from which table it must fetch the record of fees. in which table the fee details must be saved. what columns i should have in feepayment table?? please,

Kindly some one help please

Aug
31
3 months ago
Activity icon

Replied to Suggestion For Tables Collision For Main Category And Sub Category Of Fee Payment

@michapietsch thank you soo much for your response.

ya thats what i expect.

but the problem is whether to keep a text box in the form or drop down. if already it is there its id should be used. else the new record should be created.

textbox?? or dropdown?? or datalist?? which to use??? in the form??

Aug
30
3 months ago
Activity icon

Started a new Conversation Suggestion For Tables Collision For Main Category And Sub Category Of Fee Payment

Guys iam working with a school project. its a school management system.

whats my doubt is my application is dynamic, so the fee payment takes two steps,

fee structure and fee payment

first my doubt is in fee structure

the school posses Main category and sub category of fee, like below structure

Term1     payment duration (1-08-2019 to 15-08-2019)
    school Fee =  6000
    Bus Fee   =  3000
    Tution Fee= 2500

Term 2  payment duration (1-12-2019 to 15-12-2019)
    school Fee = 6000
    Lab Fee   =   3000

Term3   payment duration (1-03-2020 to 15-08-2020)
    School Fee= 6000
    extra fee = 2000

like this it goes on,

this structure may varies class wise (1 std 2nd std and so on...)

So for this i planned two tables to add the main category and the sub category.

table main category has columns like

  $table->bigIncrements('id');
            $table->bigInteger('acc_year_id')->unsigned();
            $table->foreign('acc_year_id')->references('id')->on('academic_years')->onDelete('cascade');
            $table->string('fee_main_cat');
            $table->date('due_start_date')->nullable();
            $table->date('due_end_date')->nullable();
            $table->bigInteger('total_amt')->nullable();
            $table->longText('note')->nullable();
            $table->string('status')->nullable();
            $table->timestamps();

the view of the above table is : https://imgur.com/Gwo9vYQ

and sub category table has columns below

 $table->bigIncrements('id');
            $table->bigInteger('acc_year_id')->unsigned();
            $table->foreign('acc_year_id')->references('id')->on('academic_years')->onDelete('cascade');
            $table->bigInteger('class_id')->unsigned();
            $table->foreign('class_id')->references('id')->on('class_details')->onDelete('cascade');
            $table->bigInteger('fee_main_cat_id')->unsigned();
            $table->foreign('fee_main_cat_id')->references('id')->on('fee_main_cats')->onDelete('cascade');
            $table->string('fee_sub_cat');
            $table->bigInteger('amt')->nullable();
            $table->longText('note')->nullable();
            $table->string('status')->nullable();

the view of the above table is : https://imgur.com/bNX2JOR

whether the above columns are right.

so for this i have created a form like this : https://imgur.com/z6AY2xX

in this form to add sub category i used table because for one main category there may be 2 or 3 sub categories.

in some occurrence there may not be any sub categories.

here whats the problem iam facing is, i planned everything, the fee main category which is typed by the user in the form will be added to the main category table, and the id of that is picked, and it is added to the sub categories table with its details. here the problem is i should not enter the main category two times, so used datalist in html, which act as textbox and aswell as dropdown. if data there it shows else user can enter.

but i failed. then only i got confusion.

is one form is enough for both. else need two forms.

kindly suggest your ideas please

Aug
29
3 months ago
Activity icon

Replied to Multiply The Qty And Rate From Two Tables With Same Product_id In Laravel

@snapey sorry for disturbing you once again,

small doubt

if i need the overall total amount of the <td>{{ $latestprices->where('product_id',$product->id)->first()->rate_per_kg * $product->openingstock->open_qty }} </td>

the above query is in forloop, so for each product the rate is multiplied with qty and displayed. i need the overall amount at last after the foreach means what should i do?

this means what should i do??

Aug
23
3 months ago
Activity icon

Replied to Multiply The Qty And Rate From Two Tables With Same Product_id In Laravel

@snapey thank you soo much everything worked fine.. thank you thank you..

you should do me a favor,

kindly paste your answer in this link also, because this also the same question

https://laracasts.com/discuss/channels/laravel/multiply-product-qty-with-rate-with-maximum-rate-in-the-list-in-relationship

so that u can get one credit please.

Activity icon

Replied to Multiply The Qty And Rate From Two Tables With Same Product_id In Laravel

@siangboon not like that, but when we struct in coding, suddenly it remembers Laracast, when it comes to laracast it remembers @snapey .. thats the reason..

Aug
21
3 months ago
Activity icon

Replied to Calculating Attendance Total Present And Absent Laravel

@kvithalani very sorry. some what busy in another work.

let me try it and say.

thank you for your response