Converting mysql to laravel query

Posted 1 week ago by jhutto

I have a mysql query that I can not figure out how to translate into Laravel query in controller

The 355 will be a variable as soon as I can get this to run.

SELECT, `CourseID`, `StudentID`, `StatusID`, `TA`, `DropDate`, `TuitionType`, (`ClassFee`+`HomeOfficeFee`+`MaterialsFee`) AS TotalTuition,
(SELECT SUM(`PaymentAmount`) AS TotalPayments FROM `somasstudentclasspayments` WHERE somasstudentclasspayments.RegistrationID = TotalPayments
FROM `somascourseregistrations` WHERE somascourseregistrations.CourseID = 355

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.