PHP Reddit – Telegram
PHP Reddit
34 subscribers
287 photos
36 videos
24.7K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Is adding declare(strict_types=1) increase code performance?

In Laravel and Symfony projects, I add `declare(strict_types=1);` at the top of my Controllers and Services.I know that it improves code reliability. But my teammate says it also increase code performance. Is this correct?

https://redd.it/1oqrboa
@r_php
Just published Multitron 1.0 - MIT-licensed beautiful CLI PHP Task Orchestrator library for large processes, exports, synchronizations, etc. Please give me your feedback!
https://github.com/riki137/multitron

https://redd.it/1oqt7tk
@r_php
🚀 I built a WebAuthn plugin for Laravel Jetstream + Livewire!

Hey everyone 👋

I’ve just released an open-source package I’ve been working on:
👉 [**r0073rr0r/laravel-webauthn**](https://github.com/r0073rr0r/laravel-webauthn)

It adds full **WebAuthn (passkeys, biometrics, USB keys)** support for **Laravel Jetstream + Livewire** — no external controllers, just native Livewire components.

# 🔧 What it does

* Register WebAuthn devices (fingerprint, Face ID, USB key, etc.)
* Login via WebAuthn directly through Livewire
* Works seamlessly with Jetstream (Livewire stack)
* Supports **Laravel 12**, **Livewire 3**, **Jetstream 5**, **PHP 8.2+**

# ⚙️ Installation

composer require r0073rr0r/laravel-webauthn
php artisan vendor:publish --provider="r0073rr0r\WebAuthn\WebAuthnServiceProvider"
php artisan migrate

Then include the JS file:

<noscript src="{{ asset('vendor/webauthn/webauthn/webauthn.js') }}"></noscript>

# 🧩 Usage

For registration (e.g., in your Jetstream profile page):

<livewire:webauthn-register />

For login (e.g., in your login page):

<livewire:webauthn-login />

That’s it — the components handle the WebAuthn challenge/response flow automatically.

# 💡 Why I built it

I love using Jetstream + Livewire for full-stack Laravel apps, but I couldn’t find a simple WebAuthn package that fit naturally into that ecosystem.
So I built one — fully Livewire-based, no JS frameworks, no extra controllers.
It’s lightweight, secure, and built to “feel native” inside Jetstream.

# 🛠️ Features

* Clean integration with Jetstream UI
* Configurable components (can publish & customize views)
* Works with existing user accounts
* Passkeys ready 🔐
* Open source (MIT)

💬 Feedback, ideas, and PRs are very welcome!

👉 [GitHub repo here](https://github.com/r0073rr0r/laravel-webauthn)

https://redd.it/1oqwcmc
@r_php
Just published event4u/data-helpers

During my time as a PHP developer, I often worked with DTOs. But there were always some problems:

Native DTOs don’t offer enough functionality, but they’re fast
Laravel Data has many great features, but it’s Laravel-only and quite slow
Generators aren’t flexible enough and have too limited a scope

So I developed my own package: `event4u/data-helpers`
You can find it here [
https://github.com/event4u-app/data-helpers](https://github.com/event4u-app/data-helpers)
And the documentation here [
https://event4u-app.github.io/data-helpers/](https://event4u-app.github.io/data-helpers/)

The goal was to create easy-to-use, fast, and type-safe DTOs.
But also to make it simple to map existing code and objects, map API responses directly to classes/DTOs, and easily access deeply nested data.

Here is an example, how the Dto could look like

// Dto - clean and type-safe
class UserDto extends SimpleDto
{
public function __construct(
#[Required, StringType, Min(3)]
public readonly string $name,

#[Required, IntegerType, Between(18, 120)]
public readonly int $age,

#[Required, Email]
public readonly string $email,
) {}
}

But that is not all. It also has a `DataAccessor` Class, that uses dot notations with wildcards to access complex data structures in one go.

// From this messy API response...
$apiResponse = [
'data' => [
'departments' => [
['users' => [['email' => '
alice@example.com'], ['email' => 'bob@example.com']]],
['users' => [['email' => '
charlie@example.com']]],
],
],
];

// ...to this clean result in a few lines
$accessor = new DataAccessor($apiResponse);
$emails = $accessor->get('data.departments.
.users..email');
// $emails = ['
alice@example.com', 'bob@example.com', 'charlie@example.com']

Same for Dto's

But that is not all. It also has a `DataAccessor` Class, that uses dot notations with wildcards to access complex data structures in one go.

$userDto = UserDto::create(...); // or new UserDto(...)
$userDto->get('roles.
.name'); // returns all user role names

Or just use the DataMapper with any Object

class UserModel
{
public string $fullname;
public string $mail;
}

$userModel = new UserModel(
fullname: 'Martin Schmidt',
mail: 'martin.s@example.com',
);

class UserDTO
{
public string $name;
public string $email;
}

$result = DataMapper::from($source)
->target(UserDTO::class)
->template(
'name' => '{{ user.fullname }}',
'email' => '{{ user.mail }}',
)
->map()
->getTarget(); // Returns UserDTO instance

There are a lot of features, coming with this package. To much for a small preview.
That's why i suggest to read the documentation.

I would be happy to hear your thoughts.

https://redd.it/1orkcty
@r_php
Just published Multitron 1.0 - MIT-licensed beautiful CLI PHP Task Orchestrator library for large processes, exports, synchronizations, etc. Please give me your feedback!
https://github.com/riki137/multitron

https://redd.it/1orpuwd
@r_php
Livewire Workflows

I just released my first package, Livewire Workflows, for easily creating multi-step workflows and form wizards from full-page Livewire components. The package provides for easy definition of workflows and guards, and handles route definition, navigation, and state management, offering helper methods for manual management. How can I improve this package to make it the most beneficial for you?

https://github.com/pixelworxio/livewire-workflows

https://redd.it/1osah5j
@r_php
php.ini - apache2 - not reflecting ini changes

I need to increase maxinputvars used by Apache. However the value I set in php.ini are being updated when I call phpinfo.

I can see the file being used as it's shown in phpinfo output. I've changed it and the CLI php.info and can see the CLI functions as expected. Changed every php.ini file available even though I know which one is being used. Server has been restarted (repeatedly lol).

My only guess is that occasionally I insert an "x" into a file try to close nano, which uses ctrl+x to close. This could maybe corrupt the file and it's just being ignored.

https://redd.it/1oscg87
@r_php
PHP library for handling large CSV files efficiently (stream-based + callable support) new Version 1.3.0

Good day, everyone!

Like in my previous post, I’d like to share version 1.3.0 of csv-manager, an open source PHP library I’ve been working on.

I listened to the feedback and suggestions from the community, and as a result, version 1.3.0 includes several bugs fixed and important improvements. I also made sure to keep it backward compatible with the previous versions.

The README has been updated with new usage examples and notes about deprecated functionality.

My plan is to continue expanding this library, adding mote features to the Facade, improving flexibility for different use cases, and supporting new formats in upcoming versions. I’ll be working on these updates over the next few days.

Of course, I’d really appreciate any feedback, suggestions, or opinions you might have.

REPO: https://gitlab.com/jcadavalbueno/csv-manager

Thanks for reading, and have a great day!

https://redd.it/1osie4v
@r_php
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/1osq0ws
@r_php
Laravel Post-Deployment Setup Wizard

https://reddit.com/link/1ot0q1f/video/6lpmsnb20c0g1/player

This is a specialized post-deployment setup wizard for a Laravel project for non-tech users. But it occurred to me, if I were to wrap this into a package, would it be helpful for others too?

I can create a more generic and customizable setup wizard like this, but only if it would actually be useful. Otherwise, I don’t want to spend time and effort on something that nobody would care about.

What’s your take on this?

https://redd.it/1ot0q1f
@r_php
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/1ot4947
@r_php
Introducing html-to-markdown PHP bindings

Hi Peeps,

I am the author of html-to-markdown - a Rust library for parsing HTML 5 into CommonMark compliant markdown (GitHub flavor syntax also supported).

The Rust library has a CLI, and its offered in the following languages - with fully typed safe bindings:

1. Python
2. TypeScript (both native and WASM)
3. Ruby
4. PHP (new!)

The readme for the PHP package includes installation and usage guidelines.

I'd be happy for any feedback!

https://redd.it/1ot656d
@r_php
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/1ot7453
@r_php