PHP Reddit – Telegram
PHP Reddit
33 subscribers
293 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
Reminder: if you prefer to develop on Homestead, it's still maintained as a fork!

Some people don't like the new development solutions offered by Laravel, such as Herd (which, let's not forget, it's not an official Laravel product).

Luckily, the good old Laravel Homestead is still maintained by the original author, just under a new fork.

Switching is easy, as the developer says:

>You should be able to destroy your laravel/homestead VM, copy your Homestead.yaml into the forked repo, and spin up a fresh instance from there. If not please come back and open an issue and let me know what went wrong.

GitHub repo: https://github.com/svpernova09/homestead

If you, like me, prefer to develop on a Homestead machine, show your support to the developer and don't forget to star the repo!

https://redd.it/1j21sbw
@r_php
Interface typehinting on phpstan

I have a question regarding interface type hinting on strict mode. I have an interface that several classes implements and each class return different types and I'm forced to make it mixed to make phpstan happy:

Interface:

/**

* Get the wrapper content.

*

* @ return array<mixed, mixed> The content.

*/

public function getContent(): array;


How do I go about explicitly typing return type of the implementing classes while having generalized return type to my interface? Or should I just get rid of the interface itself and have more control to the specific classes that implement the method?

https://redd.it/1j27osl
@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/1j2aaaa
@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/1j2cwpc
@r_php
Did they add breeze back to laravel installer? or does my laravel installer have a bug?

I have decided to try laravel 12. So I updated the laravel/installer to latest version 5.13.0. I run laravel new command and I see same prompts like in laravel 11. Asked me if I want to use breeze or jetstream or none. Then which breeze stack etc.

I do not see the new prompt screens shown on documentation.

After installing and running npm install. I can visit the default breeze react starter site without any issue. Laravel v12, inertia v2, react v18. Not react v19, no shadcn.

Anyone having similar issue?

I even removed and installed laravel/installer package just to be sure.

https://redd.it/1j2dttp
@r_php
My Laravel Packages

Hi everyone. I have created 2 packages for Laravel that may be useful to some of you.

1. Laravel Livewire CRUD

This package provides a comprehensive solution for CRUD operations within your Laravel applications, offering a streamlined and reusable approach for managing data. Whether you're working with Laravel controllers or Livewire components, this package allows you to:

Simplify common CRUD operations (create, read, update, delete) by abstracting and consolidating logic and reducing boilerplate code.
Enhance productivity by providing out-of-the-box methods for storing, updating, and deleting records.
Integrate seamlessly with both Laravel and Livewire, making it easy to use in traditional controllers or real-time components.
Ensure consistency across your application with standardized CRUD methods for various models.
Support bulk actions, enabling efficient mass deletion or updates of records.
Reduce development time by leveraging reusable methods for model interactions, validation and error handling.


https://github.com/milenmk/laravel-livewire-crud

2. Laravel locations

Add Countries, Cities, Areas, Languages and Currencies models to your Laravel application

https://github.com/milenmk/laravel-locations

https://redd.it/1j2ej86
@r_php
Bugsnag alternative for local installation

I’m looking for an alternative for bugsnag for local installation. I hate ELK stack, and I couldn’t connect it to all of the apps properly. It is such a headache. I’m looking for something similar to bugsnag where I composer require the package and voila. And it has to be on premise

https://redd.it/1j2eg1g
@r_php
How do you discover new/changed features in the framework?

I think it's great that Laravel is focusing on attracting new developers. And the documentation \*is\* pretty good. In fact I think it's worth reading from start to finish at least once every couple of years. But my question is this: How am I supposed to stay informed about new or changed framework features after that? Here are some comments/observations in no particular order. Because it's definitely \*not\* a rant /s.

* The upgrade notes for new major versions only tell you about breaking changes, and most new additions aren't breaking. That's how it should be. It just means you can't "Just read the upgrade notes" to get an overview of what has changed.
* New features are usually including in the weekly releases, which \*do\* have something that resembles release notes, but it's just an auto generated list of commit messages that usually don't explain a whole lot about what they actually do. And the lack of conventional commit messages make it harder to find what's relevant. I'm not arguing that it should be beautiful prose, and I don't mind diving into the source to see the details - I just don't want to review the entire diff every week because it's impossible to spot which commits are relevant.
* I browse Laravel News at least once a week. IMO this is probably the best source of information about new features for people like me who don't use twitter/mastodon/bluesky/whatever people are using this week. But it's kind of hit or miss. And their community "Links" section don't seem to be moderated at all. The [What's New in Laravel 12 : Latest Features and Updates](https://www.bacancytechnology.com/blog/laravel-12-features-updates) blog post looks like what I need (it even has a star, whatever that means), but it's just AI hallucinations and word salad from start to finish. About what you'd expect from a Google search, but this is supposedly the "official" Laravel news site (check the "News" footer link on laravel.com).

I hope some of you can enlighten me. Especially if it doesn't involve "just follow these 25 people on these 4 social media sites".

https://redd.it/1j2k7sc
@r_php
Xdebug Helper Chrome Extension alternative?

The recent Chrome update that prevents things like uBlockOrigin from working also seems to have taken out the old Xdebug Helper extension as well. I've never really thought about how else to approach activating Xdebug from the browser, other than [annoyingly\] having to append the full query param string whenever I want to use it. Is there some alternative I'm not thinking of? There's a handful of Chrome extensions that purport to do the same as the original that seem to be active still, but very few installs and reviews, so I'm iffy on trusting those.

How are you using Xdebug from the browser?

https://redd.it/1j2jp63
@r_php
Who offers affordable Wordpress hosting with CI/CD with zero-downtime dep

I got a simple site im setting up and I want to be able to push an update to my github repo that has my theme and plugins. I saw render.com but it doesnt offer zero-downtime for deployments if you have a persistent disk....meaning what if I upload images like for blog post...they wont stay so.....Now im confused on how to even do CI/CD where I can have a realistic WordPress site, using Github, and not have downtime when I push updates.

https://redd.it/1j2ndqg
@r_php
Model attributes are easy to discover

I saw a post a few days ago where everyone was asked what they could have in Laravel if they got their wish. So many people talked about the models having attributes and stuff that they couldn't just see that in their code.

I'm not saying that you'll get intellisense or other ide helpers, but model:show is awesome and has been around for a while.

Here's a tutorial so that you can access this info super fast in vs code.

https://www.openfunctioncomputers.com/blog/quick-access-to-laravel-model-info-in-vs-code

https://redd.it/1j2u7bf
@r_php
Pros and Cons by using spatie-translatable ?

Hi guys, would you use spatie-translatable for a multilanguage website (around 5-6 langs) or go with only DB schema? Are there any pros and cons using spatie??
Thanks

https://redd.it/1j3613p
@r_php
Does Laravel Cloud support Non-Laravel codebases or Docker?

The noscript is my question. We are currently in planning phase and I plan to tell the stakeholders that we want to use Laravel Cloud as hosting solution so they create accounts for me and my dev. team.

But because of our design preference, we will use Laravel specifically for API and backend tasks...
We will have 3 frontend applications with their own separate code bases... So I wonder if Laravel Cloud only allows you to host Laravel apps or can we also use it to host Svelte and React codebases that doesn't have PHP code at all?

I wonder if we can also use Docker images on Laravel Cloud as well.

https://redd.it/1j36bd7
@r_php
Alpine & Livewire Tooling

There are tools like PHPStan (for PHP) and ESLint (for Vue / React), which can identify problems ahead of time.

When it comes to Alpine/Livewire, what tools do you guys use for error detection / static analysis? Does anything like this exist yet?

https://redd.it/1j3aa8n
@r_php
HTMP: A Smarter, Faster Future for PHP Development

PHP has been the backbone of web development for decades, yet many templating engines and frameworks introduce unnecessary complexity, security risks, or performance bottlenecks. Enter HTMP (Hyper Text Markup PHP)—a next-generation PHP framework and templating engine designed to be lightweight, AI-powered, and optimized for speed, security, and scalability.

Unlike Blade, Twig, or Smarty, HTMP offers:

Optimized Execution – Eliminates redundant code for better performance.
AI Integration – Native AI hooks enable predictive content and automation.
Enterprise Security – Built-in XSS, CSRF, and SQL injection protection.
Seamless WordPress Support – Works out of the box with WordPress for high-performance themes and plugins.

Example of its intuitive syntax:
<htmp-template name="user-profile">
<htmp-if condition="user.isLoggedIn">
<htmp-text>Welcome, {user.name}!</htmp-text>
<htmp-button action="logout">Log Out</htmp-button>
</htmp-if>
<htmp-else>
<htmp-button action="login">Log In</htmp-button>
</htmp-else>
</htmp-template>

HTMP’s AI-driven automation could change how developers handle dynamic content, SEO, and user experiences without relying on external noscripts. It is designed to scale from small applications to enterprise-level platforms.

Would you use something like this? How do you see AI fitting into the future of PHP frameworks?

Github Repo: https://github.com/aedin-insight/htmp

https://redd.it/1j3a7a7
@r_php
Do you use templating engine ?

If you use which one you prefer ? Twig ? Blade or something else ?

Im not using any templating engine,
I wanna do the old ways but idk if its good way.

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