PHP Reddit – Telegram
PHP Reddit
34 subscribers
292 photos
37 videos
24.9K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
PHP & Symfony MMO - new item equipping feature

After a week of thinking, about the relationship between item and instance, I am ready to announce that the ability to equip items that implement the ItemEquipmentInstanceInterface is available.

In this case, the Wooden Sword, will confer +5 to physical attack while equipped, making you stronger against all mobs, including the latest implemented: Sbinsol.

Sbinsol is a water lizard, wanted and implemented by my younger brother, who got curious about the video game and wanted to develop it.In Symfony MMO creating a new mob is very easy, almost like writing a denoscriptive text. Maybe I can make a video where I illustrate it. We'll see...

Read more on my Patreon post: https://www.patreon.com/posts/124934660?utmcampaign=postsharecreator&utmcontent=androidshare


https://redd.it/1jhhnbr
@r_php
How to fix "undefined index" globally in PHP8.x?

Hello,

I have to migrate some websites that were created under PHP 5.x to PHP 8.x
Most of the time, the frontend works right away or only needs minor changes.

The administration is driving me nuts though.
First off, it was custom made 10+ years ago and not the very elegant of code to begin with. But it works fine up to PHP 7.x

With PHP8 I get tons of "undefined index" errors. This happens, because of checking variables that do not exist (are not set) yet. It never was a problem before, but PHP8 is very strict about it.

For instance:

if($_SESSION['order'] == "" AND $_GET['order'] == "")
{
$_SESSION['order'] = $default_order;
}

immediately throws an error if neither Session nor Get are set.
Please don't get mad about this very code, I know it's not good, it's just to demonstrate.

The problem is, that there are a lot of variables that CAN be set but don't have to be, depending on the actual area.

It is not feasible to start by setting each and every variable at the top, there are way to many and some of them are dynamically set too.
It is also not feasible to insert if isset() into every statement.

Sure, I can supress errors, but I'd rather fix this for good.
Is there a way to tell PHP8 to assume those variables are set but empty until I actually give them a value?





https://redd.it/1jhtm98
@r_php
Issue 55 of "A Day With Laravel" : SVG and security, Eloquent Filter, What's new in Laravel 12.2, Laravel's New JobQueueing Event and Package Laravel Feature Flag are discussed

https://preview.redd.it/4q5caexiofqe1.jpg?width=1280&format=pjpg&auto=webp&s=a244f680c461261ca7e5652685e07b271aadc372

Hello Laravel friends 👋

Today in "**A Day With Laravel**", I present the following topics :

* Security Tip: Excluding SVGs from Image Validation! *by Stephen Rees-Carter*
* Eloquent Filter package *by Mehdi Fathi*
* What's new in Laravel 12.2 *by Christoph Rumpel*
* Enhance Your Queue System with Laravel's New JobQueueing Event *by Harris Raftopoulos* 
* Package Laravel Feature Flag *by Peter Fox*

I really hope this free content brings value to you.

Let me know in comment what do you think about it.

[https://go.itanea.fr/adwl55](https://go.itanea.fr/adwl55)

See you on the next issue.



https://redd.it/1jhys0i
@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/1ji3xy4
@r_php
pdf-to-zpl: A library that encodes PDFs and Images into a printable format (image manipulation with PHP)

This may seem like a niche issue but anyone that has worked will Zebra printers will have come across it. Even if you've never ran into this issue, check out the code so you can see how to work with images and PDFs using GD and Imagick. Any suggestions / improvements are welcome!

https://github.com/benfaerber/pdf-to-zpl

Here's how the algorithm works:

1. Loads the PDF and render each page as image using Imagick
2. Scale the image to match the DPI and aspect ratio of the label
3. Convert each page into a grayscaled bitmap
4. Run line encode the bitmap and marshall it into a ZPL binary representation

#

https://redd.it/1jidac0
@r_php
Symfony vs Laravel: Contributions to the PHP Ecosystem (Visualized with Neo4j)
https://redd.it/1jied2m
@r_php
A non empty secret is required- easyadmin+symfony7.2

Hi,

I was trying my project on separate machine and this error came out. It doesnt happen in other machine.


What can go wrong?

Best regards,






https://redd.it/1jimcdz
@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/1jihf4b
@r_php
Ecotone Framework - New website and Enterprise version

Hey,

Some of you may already know me, I am author of Ecotone Framework and I am posting PHP related articles about Message-Driven Systems, DDD and Architecture in general.
And today I would like to share two big changes to Ecotone Framework, that I've been working on for over year.

I know that due to volume of features, Ecotone's documentation may require time to fully go over different functionalities and reasoning behind them.
And of course not everyone have time to do so, or simply one could feel that all the tools Ecotone provides he already use therefore there is no point in testing it out.
Therefore to make it clear what Ecotone is about, what it provides, without requiring bigger time investment, Ecotone comes now with new website at: https://ecotone.tech

The aim of new website is to provide as much as possible details to get general feeling, without the need to install or run the framework itself.
New website provides denoscription of features, detailed code examples, and steps on how to get started.
I hope this will be helpful in giving more details on Ecotone in quick and easy way, and will help to make the decision whatever it can help your project.

The other big thing which Ecotone brings to the table, is Enterprise version.
Ecotone Enterprise includes more custom advanced features, additional integrations, and ability to optimizatize the system usage.
The aim of Enterprise is to get more support for Ecotone, in order to build even more tooling around it.
To get more details about some of the core Enterprise features, you take a look on today's article: https://blog.ecotone.tech/ecotone-enterprise-kafka-distributed-bus-dynamic-channels-and-more-2

thank you,
cheers :)

https://redd.it/1jikore
@r_php
Filament Json Column - Releasing v1.6.1

Hey everyone!
If you've used FilamentPHP, you might have heard about Filament Json Column, as the plugin is now getting closer to a 100K downloads.
I've made a new release, with a whole rewritten code base for better maintainability (Ok, it's not that big but still). I've added the following features:

Validation: If the JSON is invalid, the user can't switch tabs or submit. An error message is displayed on submission. Error message can be customized and supports \`\_\_()\`
Editor mode customization (code, text, tree, etc...)

Please see the updated docs on the link above. Planning to add an Infolist component, and some Alpine automated testing. If you have suggestions, or want to contribute, please don't hesitate to send me a message here or a pull request on GitHub.
Have a great day!

https://redd.it/1jistnh
@r_php
Is it possible to embed a CRUD within another CRUD using EasyAdmin?

I am working on a Symfony 7 project that uses EasyAdmin 4 for the back-office. I have a Formation entity that can have multiple Prices.

In the creation and editing views of Formation, I would like to add a "Prices" tab containing an index and a CRUD EasyAdmin to manage (create and modify) the prices associated with the formation. How can I achieve this?

I have looked for tutorials but haven't found anything similar. I also tried to figure it out on my own, but it didn't lead to any conclusive results.

here is an example of what i'm trying to do




https://redd.it/1jiszoz
@r_php
is there in-memory search engine for PHP?

Does php have an in-memory search library?
like https://duckdb.org? or lucene?

I'm aware of elasticsearch and solr and redis search, but was hoping for something simpler.

https://redd.it/1jitw6s
@r_php
Symfony API docs

I've noticed that there is an API documentation for laravel https://api.laravel.com/docs/12.x/index.html

does symfony have the same documentation? it seems really helpful.



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