A Week of Symfony #955 (April 14–20, 2025)
https://symfony.com/blog/a-week-of-symfony-955-april-14-20-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1k3hnfz
@r_php
https://symfony.com/blog/a-week-of-symfony-955-april-14-20-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1k3hnfz
@r_php
Symfony
A Week of Symfony #955 (April 14–20, 2025) (Symfony Blog)
This week, the upcoming Symfony 7.3 version improved the AsAlias attribute by adding a new argument, introduced Clock support for UriSigner, and refined the return type of the `ContainerInterface::get…
One month into PHP and I feel like I’m getting nowhere. Is this normal ?
I’ve just started learning PHP from scratch it’s been almost a month now. But honestly, I’m finding it super boring. Feels like I’m not getting anywhere. I study, but nothing sticks… I keep forgetting everything. Does this happen to everyone, or is it just me?
https://redd.it/1k3j7m6
@r_php
I’ve just started learning PHP from scratch it’s been almost a month now. But honestly, I’m finding it super boring. Feels like I’m not getting anywhere. I study, but nothing sticks… I keep forgetting everything. Does this happen to everyone, or is it just me?
https://redd.it/1k3j7m6
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Weekly /r/Laravel Help Thread
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1k3r4oz
@r_php
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1k3r4oz
@r_php
Laravel
Installation - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
[Symfony Bundle] Entity Kit Bundle
https://github.com/abdellahrk/EntityKitBundle
https://redd.it/1k3rvea
@r_php
https://github.com/abdellahrk/EntityKitBundle
https://redd.it/1k3rvea
@r_php
GitHub
GitHub - abdellahrk/EntityKitBundle: Entity Bundle Kit is a modern Symfony bundle that gives your Doctrine entities superpowers…
Entity Bundle Kit is a modern Symfony bundle that gives your Doctrine entities superpowers with minimal boilerplate. It provides a growing collection of prebuilt behaviors — like Timestamp, Sluggin...
[Symfony Bundle] Entity Kit Bundle
https://github.com/abdellahrk/EntityKitBundle
https://redd.it/1k3s2au
@r_php
https://github.com/abdellahrk/EntityKitBundle
https://redd.it/1k3s2au
@r_php
GitHub
GitHub - abdellahrk/EntityKitBundle: Entity Bundle Kit is a modern Symfony bundle that gives your Doctrine entities superpowers…
Entity Bundle Kit is a modern Symfony bundle that gives your Doctrine entities superpowers with minimal boilerplate. It provides a growing collection of prebuilt behaviors — like Timestamp, Sluggin...
Weekly Ask Anything Thread
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1k43szz
@r_php
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1k43szz
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Weekly help thread
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1k46h74
@r_php
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1k46h74
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Add Engaging Animations To Your Webapp for FREE
https://backpackforlaravel.com/articles/tutorials/add-engaging-animations-to-your-web-app-for-free
https://redd.it/1k47e3x
@r_php
https://backpackforlaravel.com/articles/tutorials/add-engaging-animations-to-your-web-app-for-free
https://redd.it/1k47e3x
@r_php
Backpack for Laravel
Add Engaging Animations To Your Webapp for FREE
Lottie animations have become a popular choice for adding rich, engaging animations to websites and apps. They’re lightweight, scalable...
I want to optimze this code, Now it just pending, not getting rendered html
public function getFilterData(Request $request)
{
try {
$sbu = $request->sbu;
$location = $request->location;
$customer = $request->customer;
$salesRep = $request->salesRep;
$asAt = $request->asAt;
$html = ''; //html table
//common style
$styles = [
'borderTop' => 'border-top: 2px solid #000;',
'borderBottom' => 'border-bottom: 1px solid #000; border-bottom: 3px double #000;',
'textAlign' => 'text-align: right;',
];
$count = 1; //count
$data = $this->requiredData($sbu, $location, $customer, $salesRep, $asAt, $request);
//grouped data
$groupedCollection = $data->groupBy('cti');
//all sum
$totalAmountSumAll = 0;
$paymentSumAll = 0;
$balanceSumAll = 0;
$oneOverDueSumAll = 0;
$twoOverDueSumAll = 0;
$threeOverDueSumAll = 0;
$fourOverDueSumAll = 0;
$fiveOverDueSumAll = 0;
$sixOverDueSumAll = 0;
$lateFeesSumAll = 0;
$totalDueSumAll = 0;
//set table data
$callingCod = '';
if ($groupedCollection != null) {
foreach ($groupedCollection as $key => $group) {
$customerCode = isset($group[0]['cusCode']) ? $group[0]['cusCode'] : null;
$customerName = isset($group[0]['cusName']) ? $group[0]['cusName'] : null;
$callingCode = isset($group[0]['cCodeGMoNo']) ? $group[0]['cCodeGMoNo'] : null;
$mobileNo = isset($group[0]['gBNo']) ? $group[0]['gBNo'] : null;
//set calling code
$cCode = $this->callingCode($callingCode);
if (!empty($cCode) && isset($cCode[0]['callingCode'])) {
$callingCod = $cCode[0]['callingCode'];
}
$html .= '<tr>
<td></td>
<td colspan="4"><strong>' . $customerCode . ' : ' . $customerName . (!empty($mobileNo) ? ' | +' . $callingCod . ' ' . $mobileNo : '') . '</strong></td>
</tr>';
//customer wise sum
$totalAmountSum = 0;
$paymentSum = 0;
$balanceSum = 0;
$oneOverDueSum = 0;
$twoOverDueSum = 0;
$threeOverDueSum = 0;
$fourOverDueSum = 0;
$fiveOverDueSum = 0;
$sixOverDueSum = 0;
$lateFeesSum = 0;
$totalDueSum = 0;
// Apply chunking to the group processing - chunk size of 100 can be adjusted
$chunkSize = 100;
$chunks = array_chunk($group->toArray(), $chunkSize);
foreach ($chunks as $chunk) {
// Process each chunk of items
foreach ($chunk as $item) {
//get date difference
$asAtDate = Carbon::parse($asAt);
$effectiveDate = !empty($item['invoiceDate']) ? $item['invoiceDate'] : (!empty($item['cicDate']) ? $item['cicDate'] : (!empty($item['odInvoiceDate']) ? $item['odInvoiceDate'] : null));
$effectiveDate = Carbon::parse($effectiveDate);
$overDueVal = $asAtDate->diffInDays($effectiveDate);
public function getFilterData(Request $request)
{
try {
$sbu = $request->sbu;
$location = $request->location;
$customer = $request->customer;
$salesRep = $request->salesRep;
$asAt = $request->asAt;
$html = ''; //html table
//common style
$styles = [
'borderTop' => 'border-top: 2px solid #000;',
'borderBottom' => 'border-bottom: 1px solid #000; border-bottom: 3px double #000;',
'textAlign' => 'text-align: right;',
];
$count = 1; //count
$data = $this->requiredData($sbu, $location, $customer, $salesRep, $asAt, $request);
//grouped data
$groupedCollection = $data->groupBy('cti');
//all sum
$totalAmountSumAll = 0;
$paymentSumAll = 0;
$balanceSumAll = 0;
$oneOverDueSumAll = 0;
$twoOverDueSumAll = 0;
$threeOverDueSumAll = 0;
$fourOverDueSumAll = 0;
$fiveOverDueSumAll = 0;
$sixOverDueSumAll = 0;
$lateFeesSumAll = 0;
$totalDueSumAll = 0;
//set table data
$callingCod = '';
if ($groupedCollection != null) {
foreach ($groupedCollection as $key => $group) {
$customerCode = isset($group[0]['cusCode']) ? $group[0]['cusCode'] : null;
$customerName = isset($group[0]['cusName']) ? $group[0]['cusName'] : null;
$callingCode = isset($group[0]['cCodeGMoNo']) ? $group[0]['cCodeGMoNo'] : null;
$mobileNo = isset($group[0]['gBNo']) ? $group[0]['gBNo'] : null;
//set calling code
$cCode = $this->callingCode($callingCode);
if (!empty($cCode) && isset($cCode[0]['callingCode'])) {
$callingCod = $cCode[0]['callingCode'];
}
$html .= '<tr>
<td></td>
<td colspan="4"><strong>' . $customerCode . ' : ' . $customerName . (!empty($mobileNo) ? ' | +' . $callingCod . ' ' . $mobileNo : '') . '</strong></td>
</tr>';
//customer wise sum
$totalAmountSum = 0;
$paymentSum = 0;
$balanceSum = 0;
$oneOverDueSum = 0;
$twoOverDueSum = 0;
$threeOverDueSum = 0;
$fourOverDueSum = 0;
$fiveOverDueSum = 0;
$sixOverDueSum = 0;
$lateFeesSum = 0;
$totalDueSum = 0;
// Apply chunking to the group processing - chunk size of 100 can be adjusted
$chunkSize = 100;
$chunks = array_chunk($group->toArray(), $chunkSize);
foreach ($chunks as $chunk) {
// Process each chunk of items
foreach ($chunk as $item) {
//get date difference
$asAtDate = Carbon::parse($asAt);
$effectiveDate = !empty($item['invoiceDate']) ? $item['invoiceDate'] : (!empty($item['cicDate']) ? $item['cicDate'] : (!empty($item['odInvoiceDate']) ? $item['odInvoiceDate'] : null));
$effectiveDate = Carbon::parse($effectiveDate);
$overDueVal = $asAtDate->diffInDays($effectiveDate);
//over due
$oneOverDue = 0;
$twoOverDue = 0;
$threeOverDue = 0;
$fourOverDue = 0;
$fiveOverDue = 0;
$sixOverDue = 0;
if ($overDueVal >= 1 && $overDueVal <= 7) {
$oneOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 8 && $overDueVal <= 14) {
$twoOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 15 && $overDueVal <= 30) {
$threeOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 31 && $overDueVal <= 60) {
$fourOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 61 && $overDueVal <= 90) {
$fiveOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal > 91) {
$sixOverDue = $item['amount'] - $item['paymnt'];
}
$balance = $item['amount'] - $item['paymnt']; //balance
$lateFee = $item['lateFee'] - $item['stlmntDiscnt'];
$totalDue = $balance + $lateFee; //total due
$html .= '<tr>
<td>' . $count++ . '</td>
<td>' . ($item['tty'] == 1 ? 'INV' : ($item['tty'] == 2 ? 'CHQ RTN' : ($item['tty'] == 3 ? 'CRD NO' : ($item['tty'] == 4 ? 'OTH CRD' : '')))) . '</td>
<td>' . (isset($item['invoiceNo']) ? $item['invoiceNo'] : (isset($item['inhandChequeNo']) ? $item['inhandChequeNo'] : (isset($item['oldInvoiceNo']) ? $item['oldInvoiceNo'] : ''))) . '</td>
<td>' . (!empty($item['invoiceDate']) ? $item['invoiceDate'] : (!empty($item['cicDate']) ? $item['cicDate'] : (!empty($item['odInvoiceDate']) ? $item['odInvoiceDate'] : '-'))) . '</td>
<td>' . (isset($item['invoiceNo']) && $item['invMrf'] !== null ? $item['invMrf'] : '-') . '</td>
<td style="text-align: right">' . (isset($item['creditPeriodDays']) ? $item['creditPeriodDays'] : 0) . ' Days' . '</td>
<td style="text-align: right">' . $item['remngDays'] . ' Days' . '</td>
<td style="text-align: right">' . ($item['amount'] !== 0.0 && $item['amount'] !== 0 ? number_format($item['amount'], 2) : '-') . '</td>
<td style="text-align: right">' . ($item['paymnt'] !== 0.0 && $item['paymnt'] !== 0 ? number_format($item['paymnt'], 2) : '-') . '</td>
<td style="text-align: right">' . number_format($item['amount'] - $item['paymnt'], 2) . '</td>
<td style="text-align: right">' . ($oneOverDue !== 0 && $oneOverDue !== 0.0 ? number_format($oneOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($twoOverDue !== 0 && $twoOverDue !== 0.0 ? number_format($twoOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($threeOverDue !== 0 && $threeOverDue !== 0.0 ? number_format($threeOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($fourOverDue !== 0 && $fourOverDue !== 0.0 ? number_format($fourOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($fiveOverDue !== 0 && $fiveOverDue !== 0.0 ? number_format($fiveOverDue, 2) : '-') . '</td>
$oneOverDue = 0;
$twoOverDue = 0;
$threeOverDue = 0;
$fourOverDue = 0;
$fiveOverDue = 0;
$sixOverDue = 0;
if ($overDueVal >= 1 && $overDueVal <= 7) {
$oneOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 8 && $overDueVal <= 14) {
$twoOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 15 && $overDueVal <= 30) {
$threeOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 31 && $overDueVal <= 60) {
$fourOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal >= 61 && $overDueVal <= 90) {
$fiveOverDue = $item['amount'] - $item['paymnt'];
} else if ($overDueVal > 91) {
$sixOverDue = $item['amount'] - $item['paymnt'];
}
$balance = $item['amount'] - $item['paymnt']; //balance
$lateFee = $item['lateFee'] - $item['stlmntDiscnt'];
$totalDue = $balance + $lateFee; //total due
$html .= '<tr>
<td>' . $count++ . '</td>
<td>' . ($item['tty'] == 1 ? 'INV' : ($item['tty'] == 2 ? 'CHQ RTN' : ($item['tty'] == 3 ? 'CRD NO' : ($item['tty'] == 4 ? 'OTH CRD' : '')))) . '</td>
<td>' . (isset($item['invoiceNo']) ? $item['invoiceNo'] : (isset($item['inhandChequeNo']) ? $item['inhandChequeNo'] : (isset($item['oldInvoiceNo']) ? $item['oldInvoiceNo'] : ''))) . '</td>
<td>' . (!empty($item['invoiceDate']) ? $item['invoiceDate'] : (!empty($item['cicDate']) ? $item['cicDate'] : (!empty($item['odInvoiceDate']) ? $item['odInvoiceDate'] : '-'))) . '</td>
<td>' . (isset($item['invoiceNo']) && $item['invMrf'] !== null ? $item['invMrf'] : '-') . '</td>
<td style="text-align: right">' . (isset($item['creditPeriodDays']) ? $item['creditPeriodDays'] : 0) . ' Days' . '</td>
<td style="text-align: right">' . $item['remngDays'] . ' Days' . '</td>
<td style="text-align: right">' . ($item['amount'] !== 0.0 && $item['amount'] !== 0 ? number_format($item['amount'], 2) : '-') . '</td>
<td style="text-align: right">' . ($item['paymnt'] !== 0.0 && $item['paymnt'] !== 0 ? number_format($item['paymnt'], 2) : '-') . '</td>
<td style="text-align: right">' . number_format($item['amount'] - $item['paymnt'], 2) . '</td>
<td style="text-align: right">' . ($oneOverDue !== 0 && $oneOverDue !== 0.0 ? number_format($oneOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($twoOverDue !== 0 && $twoOverDue !== 0.0 ? number_format($twoOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($threeOverDue !== 0 && $threeOverDue !== 0.0 ? number_format($threeOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($fourOverDue !== 0 && $fourOverDue !== 0.0 ? number_format($fourOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($fiveOverDue !== 0 && $fiveOverDue !== 0.0 ? number_format($fiveOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($sixOverDue !== 0 && $sixOverDue !== 0.0 ? number_format($sixOverDue, 2) : '-') . '</td>
<td style="text-align: right">' . ($lateFee !== 0.0 && $lateFee !== 0 ? number_format($lateFee, 2) : '-') . '</td>
<td style="text-align: right">' . ($totalDue !== 0.0 && $totalDue !== 0 ? number_format($totalDue, 2) : '-') . '</td>
</tr>';
$totalAmountSum += $item['amount'];
$paymentSum += $item['paymnt'];
$balanceSum += $balance;
$oneOverDueSum += $oneOverDue;
$twoOverDueSum += $twoOverDue;
$threeOverDueSum += $threeOverDue;
$fourOverDueSum += $fourOverDue;
$fiveOverDueSum += $fiveOverDue;
$sixOverDueSum += $sixOverDue;
$lateFeesSum += $lateFee;
$totalDueSum += $totalDue;
}
}
//set customer wise sum
$html .= '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalAmountSum !== 0.0 && $totalAmountSum !== 0 ? number_format($totalAmountSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($paymentSum !== 0.0 && $paymentSum !== 0 ? number_format($paymentSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($balanceSum !== 0.0 && $balanceSum !== 0 ? number_format($balanceSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($oneOverDueSum !== 0.0 && $oneOverDueSum !== 0 ? number_format($oneOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($twoOverDueSum !== 0.0 && $twoOverDueSum !== 0 ? number_format($twoOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($threeOverDueSum !== 0.0 && $threeOverDueSum !== 0 ? number_format($threeOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fourOverDueSum !== 0.0 && $fourOverDueSum !== 0 ? number_format($fourOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fiveOverDueSum !== 0.0 && $fiveOverDueSum !== 0 ? number_format($fiveOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($sixOverDueSum !== 0.0 && $sixOverDueSum !== 0 ? number_format($sixOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($lateFeesSum !== 0.0 && $lateFeesSum !== 0 ? number_format($lateFeesSum, 2) : '-') . '</td>
<td style="text-align: right">' . ($lateFee !== 0.0 && $lateFee !== 0 ? number_format($lateFee, 2) : '-') . '</td>
<td style="text-align: right">' . ($totalDue !== 0.0 && $totalDue !== 0 ? number_format($totalDue, 2) : '-') . '</td>
</tr>';
$totalAmountSum += $item['amount'];
$paymentSum += $item['paymnt'];
$balanceSum += $balance;
$oneOverDueSum += $oneOverDue;
$twoOverDueSum += $twoOverDue;
$threeOverDueSum += $threeOverDue;
$fourOverDueSum += $fourOverDue;
$fiveOverDueSum += $fiveOverDue;
$sixOverDueSum += $sixOverDue;
$lateFeesSum += $lateFee;
$totalDueSum += $totalDue;
}
}
//set customer wise sum
$html .= '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalAmountSum !== 0.0 && $totalAmountSum !== 0 ? number_format($totalAmountSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($paymentSum !== 0.0 && $paymentSum !== 0 ? number_format($paymentSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($balanceSum !== 0.0 && $balanceSum !== 0 ? number_format($balanceSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($oneOverDueSum !== 0.0 && $oneOverDueSum !== 0 ? number_format($oneOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($twoOverDueSum !== 0.0 && $twoOverDueSum !== 0 ? number_format($twoOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($threeOverDueSum !== 0.0 && $threeOverDueSum !== 0 ? number_format($threeOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fourOverDueSum !== 0.0 && $fourOverDueSum !== 0 ? number_format($fourOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fiveOverDueSum !== 0.0 && $fiveOverDueSum !== 0 ? number_format($fiveOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($sixOverDueSum !== 0.0 && $sixOverDueSum !== 0 ? number_format($sixOverDueSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($lateFeesSum !== 0.0 && $lateFeesSum !== 0 ? number_format($lateFeesSum, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalDueSum !== 0.0 && $totalDueSum !== 0 ? number_format($totalDueSum, 2) : '-') . '</td>
</tr>';
$totalAmountSumAll += $totalAmountSum;
$paymentSumAll += $paymentSum;
$balanceSumAll += $balanceSum;
$oneOverDueSumAll += $oneOverDueSum;
$twoOverDueSumAll += $twoOverDueSum;
$threeOverDueSumAll += $threeOverDueSum;
$fourOverDueSumAll += $fourOverDueSum;
$fiveOverDueSumAll += $fiveOverDueSum;
$sixOverDueSumAll += $sixOverDueSum;
$lateFeesSumAll += $lateFeesSum;
$totalDueSumAll += $totalDueSum;
}
// Rest of your code for total sum rows remains unchanged
$html .= '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>';
$html .= '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalAmountSumAll !== 0 && $totalAmountSumAll !== 0.0 ? number_format($totalAmountSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($paymentSumAll !== 0 && $paymentSumAll !== 0.0 ? number_format($paymentSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($balanceSumAll !== 0 && $balanceSumAll !== 0.0 ? number_format($balanceSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($oneOverDueSumAll !== 0 && $oneOverDueSumAll !== 0.0 ? number_format($oneOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($twoOverDueSumAll !== 0 && $twoOverDueSumAll !== 0.0 ? number_format($twoOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($threeOverDueSumAll !== 0 && $threeOverDueSumAll !== 0.0 ? number_format($threeOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fourOverDueSumAll !== 0 && $fourOverDueSumAll !== 0.0 ? number_format($fourOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fiveOverDueSumAll !== 0 && $fiveOverDueSumAll !== 0.0 ? number_format($fiveOverDueSumAll, 2) : '-') . '</td>
</tr>';
$totalAmountSumAll += $totalAmountSum;
$paymentSumAll += $paymentSum;
$balanceSumAll += $balanceSum;
$oneOverDueSumAll += $oneOverDueSum;
$twoOverDueSumAll += $twoOverDueSum;
$threeOverDueSumAll += $threeOverDueSum;
$fourOverDueSumAll += $fourOverDueSum;
$fiveOverDueSumAll += $fiveOverDueSum;
$sixOverDueSumAll += $sixOverDueSum;
$lateFeesSumAll += $lateFeesSum;
$totalDueSumAll += $totalDueSum;
}
// Rest of your code for total sum rows remains unchanged
$html .= '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>';
$html .= '<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalAmountSumAll !== 0 && $totalAmountSumAll !== 0.0 ? number_format($totalAmountSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($paymentSumAll !== 0 && $paymentSumAll !== 0.0 ? number_format($paymentSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($balanceSumAll !== 0 && $balanceSumAll !== 0.0 ? number_format($balanceSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($oneOverDueSumAll !== 0 && $oneOverDueSumAll !== 0.0 ? number_format($oneOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($twoOverDueSumAll !== 0 && $twoOverDueSumAll !== 0.0 ? number_format($twoOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($threeOverDueSumAll !== 0 && $threeOverDueSumAll !== 0.0 ? number_format($threeOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fourOverDueSumAll !== 0 && $fourOverDueSumAll !== 0.0 ? number_format($fourOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($fiveOverDueSumAll !== 0 && $fiveOverDueSumAll !== 0.0 ? number_format($fiveOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($sixOverDueSumAll !== 0 && $sixOverDueSumAll !== 0.0 ? number_format($sixOverDueSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($lateFeesSumAll !== 0 && $lateFeesSumAll !== 0.0 ? number_format($lateFeesSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalDueSumAll !== 0 && $totalDueSumAll !== 0.0 ? number_format($totalDueSumAll, 2) : '-') . '</td>
</tr>';
} else {
$html .= '<tr>
<td colspan="18">
<div role="alert" class="alert alert-warning alert-dismissible fade show" style="text-align: center;">
' . __("finance/reports/debtor_aging_details.data_empty_massage") . '
</div>
</td>
</tr>';
}
return response()->json(['stts' => 1, 'data' => $html]);
} catch (Exception $e) {
dd($e);
$randomErrorCode = errorLog(authrz_debtorAgingDetails("transaction"), $request, $e, $this->datetime);
return response()->json(['stts' => 0, "mssg" => __('message.danger'), "rfms" => __('message.dangerRef', ['refr' => $randomErrorCode]), "burl" => '#']);
}
}
I want to optimize above function and can't affect to its calculation and ui
https://redd.it/1k488xh
@r_php
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($lateFeesSumAll !== 0 && $lateFeesSumAll !== 0.0 ? number_format($lateFeesSumAll, 2) : '-') . '</td>
<td style="' . $styles['borderTop'] . ' ' . $styles['borderBottom'] . ' ' . $styles['textAlign'] . '">' . ($totalDueSumAll !== 0 && $totalDueSumAll !== 0.0 ? number_format($totalDueSumAll, 2) : '-') . '</td>
</tr>';
} else {
$html .= '<tr>
<td colspan="18">
<div role="alert" class="alert alert-warning alert-dismissible fade show" style="text-align: center;">
' . __("finance/reports/debtor_aging_details.data_empty_massage") . '
</div>
</td>
</tr>';
}
return response()->json(['stts' => 1, 'data' => $html]);
} catch (Exception $e) {
dd($e);
$randomErrorCode = errorLog(authrz_debtorAgingDetails("transaction"), $request, $e, $this->datetime);
return response()->json(['stts' => 0, "mssg" => __('message.danger'), "rfms" => __('message.dangerRef', ['refr' => $randomErrorCode]), "burl" => '#']);
}
}
I want to optimize above function and can't affect to its calculation and ui
https://redd.it/1k488xh
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Backup laravel mail Sender
Is there a way to have a bacup mail Sender, example: my main sender returned some kind of error, so the app tries to send in another one.
I did some research and find nothing about it.
https://redd.it/1k4efo7
@r_php
Is there a way to have a bacup mail Sender, example: my main sender returned some kind of error, so the app tries to send in another one.
I did some research and find nothing about it.
https://redd.it/1k4efo7
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Laravel but static?
A while back I did this small static site using jigsaw plus some simple form handling in php. It worked fine, wasn't my favorite to work with, and I kept thinking I should just have just gone with insert framework here behind cloudflare with some aggressive caching... But something something sunk cost lets just keep going.
Fast forward maybe 6 months, and I see the static pages feature in tempest and I have a "yeah that makes perfect sense, why didn't I think of that" moment.
So since I already have a bunch of blade templates for this site I decided to see what it would take to get static pages in laravel. Simpler than I expected...
https://github.com/ssnepenthe/mostly-static
It's a bit rough around the edges and I doubt I will spend much time improving it/cleaning it up. But I thought I would share in case anyone else finds it useful as a starting point for doing something similar.
https://redd.it/1k4tnzl
@r_php
A while back I did this small static site using jigsaw plus some simple form handling in php. It worked fine, wasn't my favorite to work with, and I kept thinking I should just have just gone with insert framework here behind cloudflare with some aggressive caching... But something something sunk cost lets just keep going.
Fast forward maybe 6 months, and I see the static pages feature in tempest and I have a "yeah that makes perfect sense, why didn't I think of that" moment.
So since I already have a bunch of blade templates for this site I decided to see what it would take to get static pages in laravel. Simpler than I expected...
https://github.com/ssnepenthe/mostly-static
It's a bit rough around the edges and I doubt I will spend much time improving it/cleaning it up. But I thought I would share in case anyone else finds it useful as a starting point for doing something similar.
https://redd.it/1k4tnzl
@r_php
Tempestphp
Static pages — Tempest
Tempest is a modern framework designed to enable developers to write as little framework-specific code as possible, so that they can focus on application code instead.
Have very small PHP/MySQL/HTML project, not sure best place to post it
I've looked at /phpjobs and /forhire and not sure the best place to post a request. I see some other websites, like Upwork, as well. But my project is pretty small and self-contained and I want to find a reliable freelancer.
Short version is that I have a website, six pages, with some read-only MySQL calls. I programmed it myself back in 2008, and hired a designer for the look and feel. I have work to do on the website (broken links, old information), but before I do anything I need to bring the PHP up from 7.3 to current 8.4. I haven't programmed anything in years and don't have the head for it anymore (I manage teams in a mainframe iSeries environment). So I need someone to review the code and update any decremented commands, and there are two widgets that no longer work, which probably have common solutions.
So this is a small project, maybe 10-15 hours, with no follow-up projects. I will post more information in a real "for hire" post, but right now not sure where is best to post it to get the right freelancer.
https://redd.it/1k4t64f
@r_php
I've looked at /phpjobs and /forhire and not sure the best place to post a request. I see some other websites, like Upwork, as well. But my project is pretty small and self-contained and I want to find a reliable freelancer.
Short version is that I have a website, six pages, with some read-only MySQL calls. I programmed it myself back in 2008, and hired a designer for the look and feel. I have work to do on the website (broken links, old information), but before I do anything I need to bring the PHP up from 7.3 to current 8.4. I haven't programmed anything in years and don't have the head for it anymore (I manage teams in a mainframe iSeries environment). So I need someone to review the code and update any decremented commands, and there are two widgets that no longer work, which probably have common solutions.
So this is a small project, maybe 10-15 hours, with no follow-up projects. I will post more information in a real "for hire" post, but right now not sure where is best to post it to get the right freelancer.
https://redd.it/1k4t64f
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
TALL stack + Filament = Built an invoicing app in under a week
Hey everyone,
I’ve been working with Laravel for over 10 years now, and honestly, with the TALL stack and Filament, building things has never been easier. I have been using excel 😅 to generate invoices for years and it occurred to me that I can build something with Livewire to generate and manage invoices.
Thought I’d try putting something together with Filament + Livewire, and within a week (just a few hours a day), I had a working app. It might be useful for some of you as well.
Check it out: **plaininvoice.com**
No signup or anything—just a clean way to generate and download invoices.
https://redd.it/1k4x64t
@r_php
Hey everyone,
I’ve been working with Laravel for over 10 years now, and honestly, with the TALL stack and Filament, building things has never been easier. I have been using excel 😅 to generate invoices for years and it occurred to me that I can build something with Livewire to generate and manage invoices.
Thought I’d try putting something together with Filament + Livewire, and within a week (just a few hours a day), I had a working app. It might be useful for some of you as well.
Check it out: **plaininvoice.com**
No signup or anything—just a clean way to generate and download invoices.
https://redd.it/1k4x64t
@r_php
Plaininvoice
PlainInvoice - The No-Nonsense Free Invoice Generator
Create professional invoices in seconds. No sign up required, free forever, and incredibly easy to use.
My Career Plan: Specializing in WordPress and Beyond
I want to specialize deeply in WordPress — and only WordPress. That means I won’t follow any other PHP frameworks anymore. My goal is to be able to build any type of system using WordPress just the way I envision it.
For example, I want to be capable of creating custom themes, booking systems, movie ticket reservations, food ordering platforms, online course platforms like Udemy, and more — all powered by WordPress.
Besides that, I also plan to study Node.js and Vue.js (or React.js), as well as technologies like Docker, Redis, Kafka, Message Queue systems, and design patterns.
So, if I follow this path, will I have a stable and promising career in the future?
https://redd.it/1k4xmf1
@r_php
I want to specialize deeply in WordPress — and only WordPress. That means I won’t follow any other PHP frameworks anymore. My goal is to be able to build any type of system using WordPress just the way I envision it.
For example, I want to be capable of creating custom themes, booking systems, movie ticket reservations, food ordering platforms, online course platforms like Udemy, and more — all powered by WordPress.
Besides that, I also plan to study Node.js and Vue.js (or React.js), as well as technologies like Docker, Redis, Kafka, Message Queue systems, and design patterns.
So, if I follow this path, will I have a stable and promising career in the future?
https://redd.it/1k4xmf1
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Released a #PHPStan extension which reports risky use of PSR3 compilant loggers
PHPStan Extension at https://github.com/staabm/phpstan-psr3
See https://peakd.com/hive-168588/@crell/using-psr-3-placeholders-properly for the background/examples - authored by Larry Garfield (Crell)
https://redd.it/1k50q2j
@r_php
PHPStan Extension at https://github.com/staabm/phpstan-psr3
See https://peakd.com/hive-168588/@crell/using-psr-3-placeholders-properly for the background/examples - authored by Larry Garfield (Crell)
https://redd.it/1k50q2j
@r_php
GitHub
GitHub - staabm/phpstan-psr3: FIG PSR3 PHPStan rules
FIG PSR3 PHPStan rules. Contribute to staabm/phpstan-psr3 development by creating an account on GitHub.