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
I built a static site generator in pure php

I've been working on PHPSSG recently, it's a pure php static site generator with cool features like component based routing, lifecycle hooks, caching, incremental builds, etc. Take a look, you might get some use out of it. It's minimal in design and completely configurable. It leaves a lot of decisions up to you. Templates are written in plain php but you can easily overwrite the renderer and use something like twig or blade instead if you want. PHPSSG can be your entire codebase or just a small part of it, I built it playing to PHP's strengths. I would really appreciate any feedback you have about the project, I'm completely open to suggestions and criticism.

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