PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 photos
37 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
🚀 Just released: Laravel Fast2SMS package – OTPs, DLT & Quick SMS made simple

Hey folks,

I built a Laravel package that makes sending SMS through Fast2SMS API way easier.

If you’ve ever dealt with raw SMS APIs, you know the pain — long payloads, DLT templates, sender IDs, juggling queues, etc. So I wrapped it all in a Laravel-fluent API that feels natural to work with.

# Features at a glance

Quick SMS
OTP support (super easy)
DLT template messages
Queue & scheduling support
Wallet balance check
Laravel Notifications integration

# Code example (it’s really this simple)

Fast2sms::otp('9999999999', '123456');

Or with a DLT template:

Fast2sms::dlt('9999999999', 'TEMPLATEID', ['John Doe'], 'SENDERID');

# 📦 Repo

👉 https://github.com/itxshakil/laravel-fast2sms

I’d love feedback, issues, or ideas for new features. And if you find it useful, a on GitHub would mean a lot 🙂

https://redd.it/1n0u66a
@r_php
🚀 Just released: Laravel Fast2SMS package – OTPs, DLT & Quick SMS made simple

Hey folks,

I built a Laravel package that makes sending SMS through Fast2SMS API way easier.

If you’ve ever dealt with raw SMS APIs, you know the pain — long payloads, DLT templates, sender IDs, juggling queues, etc. So I wrapped it all in a Laravel-fluent API that feels natural to work with.

# Features at a glance

Quick SMS
OTP support (super easy)
DLT template messages
Queue & scheduling support
Wallet balance check
Laravel Notifications integration

# Code example (it’s really this simple)

Fast2sms::otp('9999999999', '123456');


Or with a DLT template:

Fast2sms::dlt('9999999999', 'TEMPLATEID', ['John Doe'], 'SENDERID');


# 📦 Repo

👉 https://github.com/itxshakil/laravel-fast2sms

I’d love feedback, issues, or ideas for new features. And if you find it useful, a on GitHub would mean a lot 🙂

https://redd.it/1n0u75l
@r_php
Anyone using ADR + AAA tests in PHP/Symfony ?

# ADR + AAA in Symfony

I’ve been experimenting with an ADR (Action–Domain–Response) + AAA pattern in Symfony, and I’m curious if anyone else is using this in production, and what your thoughts are.

The idea is pretty straightforward:

- **Action** = a super thin controller that only maps input, calls a handler, and returns a JsonResponse.
- **Domain** = a handler with a single `__invoke()` method, returning a pure domain object (like `OrderResult`). No JSON, no HTTP, just business logic.
- **Response** = the controller transforms the DTO into JSON with the right HTTP code.

This way, unit tests are written in a clean AAA style (Arrange–Act–Assert) directly on the output object, without parsing JSON or booting the full kernel.

---

## Short example

```php
final class OrderResult {
public function __construct(
public readonly bool $success,
public readonly string $message = '',
public readonly ?array $data = null,
) {}
}

final class CreateOrderHandler {
public function __construct(private readonly OrderRepository $orders) {}
public function __invoke(OrderInput $in): OrderResult {
if ($this->orders->exists($in->orderId)) return new OrderResult(false, 'exists');
$this->orders->create($in->orderId, $in->customerId, $in->amountCents);
return new OrderResult(true, '');
}
}

#[Route('/api/v1/orders', methods: ['POST'])]
public function __invoke(OrderInput $in, CreateOrderHandler $h): JsonResponse {
$r = $h($in);
return new JsonResponse($r, $r->success ? 200 : 400);
}
````

And the test (AAA):

```php
public function test_creates_when_not_exists(): void {
$repo = $this->createMock(OrderRepository::class);
$repo->method('exists')->willReturn(false);
$repo->expects($this->once())->method('create');

$res = (new CreateOrderHandler($repo))(new OrderInput('o1','c1',2500));

$this->assertTrue($res->success);
}
```

---

## What I like about this approach

* Controllers are ridiculously simple.
* Handlers are super easy to test (one input → one output).
* The same handler can be reused for REST, CLI, async jobs, etc.

---

Open to any feedback — success stories, horror stories, or alternatives you prefer.


https://redd.it/1n0y29b
@r_php
Media is too big
VIEW IN TELEGRAM
Solving Concurrent User Sorting with Fractional Ranking in Laravel

https://redd.it/1n1ax1y
@r_php
I built a Centralized MTurk HIT Catcher with PHP + Usernoscripts

I built a small tool to centralize MTurk HIT catching.

\- Paste multiple HIT set IDs into a PHP page

\- Toggle ON/OFF catching via a server

\- Usernoscripts connect to MTurk accounts and auto-accept HITs

https://redd.it/1n1aj56
@r_php
Retiring code optimizes resources

The article talks of reasons why software is abandoned.

Ultimately, it leads me to believe that abandoning code optimizes costs and allows CTOs to reallocate resources to more productive avenues.


What are your stories related to abandoned software?


https://getlaminas.org/blog/2025-08-27-how-the-laminas-project-determines-when-to-abandon-a-library.html

https://redd.it/1n1dq11
@r_php
What if we improve the way developers are given access to databases

Adminer, DBeaver, MySQL Workbench, PhpMyAdmin, many developers use those tools every day to get access to databases. The problem ? They use the database credentials to connect to those tools.

What if we could improve that?

https://www.jaxon-php.org/blog/2025/08/what-if-we-improve-how-developers-access-databases.html

The article is also published on Medium.
https://medium.com/p/64cd7e2bef56

Note: built with PHP and Laravel.

https://redd.it/1n1skol
@r_php
I built a Centralized MTurk HIT Catcher with PHP + Usernoscripts

I built a small tool to centralize MTurk HIT catching.

\- Paste multiple HIT set IDs into a PHP page

\- Toggle ON/OFF catching via a server

\- Usernoscripts connect to MTurk accounts and auto-accept HITs

https://redd.it/1n23c6q
@r_php
AWS WAF Firewall rules for a Symfony application

Is anyone aware of a rule set for AWS WAF firewall that would work with a Symfony application?

I know there exists rule sets for a PHP application and a Wordpress application, but there's nothing specifically for Symfony.

Has anyone written or configured there own that they'd be willing to share?

https://redd.it/1n26aft
@r_php
Ryan Weaver, Symfony core contributor and SymfonyCasts founder and teacher, has passed away.
https://obits.mlive.com/us/obituaries/grandrapids/name/ryan-weaver-obituary?id=59303218

https://redd.it/1n2jiv0
@r_php