PHP Reddit – Telegram
PHP Reddit
34 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
Pleasently suprised with DataGrip - should I try phpstorm again?

I have been a vim user for many years. I program in vim or emacs.

In an effort to find a SQL "ide", and after trying all of them, I was really impressed with DataGrip. In the past, I didn't like full IDEs because it was "so much going on" when compared to my blank vim screen.

But DataGrip has many features to reduce clutter and noice. I like it.

Maybe I should take another crack at phpstorm. Especially cos the vim emulation is very well done.

Any one moved from vim and stayed?

https://redd.it/1j9n7u4
@r_php
Exceptions. Exceptions. Exceptions - They can derail your app

Hello Laravel community 🚀

Exceptions can often be misunderstood. I've noticed many instances on our team where try/catch blocks aren't implemented or understood as well as they could be.

This isn’t an all-inclusive guide, but I’ve put together a few examples to h-elp improve how you handle them. For some practical insights, check out this article:


https://james.buzz/blog/how-to-handle-exceptions-in-laravel/

https://redd.it/1j9ockn
@r_php
VueJS - How good is the new starter kit?

I never used a component library to build a frontend in VueJS. My main to go CSS framework is Tailwind + Daisyui (or something related).

However, after seeing code and examples of the provided component library (I also like you actually publish them in your own src), I'm thinking of moving to the provided starter kit instead. It does save me a lot of component creating, and cva looks nice.

Could you tell me how your experience have been or if you did go for something else? I don't want to customize, but I also want something that is kinda useable for the upcoming 2 years.

https://redd.it/1j9ty0q
@r_php
Enum in php and database

Let say I have enum gender: male , female ,indeterminate and unknown.

In database(postgresql) i use smallint data type.

In symfony, to make coding easier i create enum class Gender as string so that when displaying, i can simply call Gender.male Gender.female etc.

Is there programming technique in symfony that I can use so that when entity is being committed to database, its gender enum can be converted into smallint enum and likewise when entity being read from database, smallint datatype enum being converted into string enum.

https://redd.it/1ja248w
@r_php
Brothers, I have made this new Portfolio Website for a freelance Penetration Tester, How is this?
https://aaryansaharan.me/

https://redd.it/1ja3bkt
@r_php
Socialite Plus – Laravel 12 Social Login for React & Vue (Google, Facebook, GitHub, LinkedIn)

Hey devs! 👋

I built Socialite Plus because I needed it. As a Laravel developer, I work with clients who almost always require social login for their projects. Setting it up over and over again was tedious, so I built this package to make it faster, easier, and more streamlined—and now I’m sharing it with the community!

It’s designed for Laravel 12 Starterkits (both Vue & React) and supports Google, Facebook, GitHub, and LinkedIn authentication out of the box.

🎥 Watch the Full Video Tutorial: https://www.youtube.com/watch?v=X96PTlPUlaQ

💻 GitHub: https://github.com/deemonic/socialiteplus

# 🔥 Why Use Socialite Plus?

Pre-built login pages – No need to build them from scratch
React & Vue support – Works with both Starterkits
Easy OAuth setup – Just update .env and you're good to go
Supports Google, Facebook, GitHub, LinkedIn
Fully customizable buttons & styles
Secure & scalable – Built with best practices
Quick installation – Takes minutes, not hours!

Socialite Plus GitHub Provider Active

Socialite Plus All Providers Active

Socialite Plus Dark Mode Enabled

Non Branded Buttons Dark

Non Branded Buttons Light

Would love to hear your thoughts! If you try it out, let me know how it works for you. Open to feedback, feature requests, and contributions! 🚀🔥

👉 Are there any other social login providers you'd like to see added to the package? Let me know in the comments! Would love to expand support based on what the community needs.

https://redd.it/1ja964z
@r_php
Safari for web dev

Is anyone using Safari for web development with Symfony?

I love the whole browser except for the fact that Symfony error pages are not rendered in the network response tab of Safari like they are in Chrome, Arc etc.

Does anyone know a fix for this?

Thank you!

https://redd.it/1jab32r
@r_php
How are we all finding Laravel Cloud so far?

It has been a little while since Cloud's release, I've deployed a small application to it and so far it's worked absolutely fine, but admittedly it's not a complex project and just uses Blade.

For those that are using Cloud, and especially ones with complex apps, how are you fiinding it?

https://redd.it/1jab5wj
@r_php
From Laravel to Symfony | Day 2

Continuing my series on learning Symfony to transition from Laravel, today I’m diving into Dependency Injection (DI), the service container, and want to talk the contrast between simple and complex solutions in both frameworks. If you missed the previous parts, you can find them here:

[From Laravel to Symfony | Day 0](https://www.reddit.com/r/symfony/comments/1ins69p/from_laravel_to_symfony_day_0/)

[From Laravel to Symfony | Day 1](https://www.reddit.com/r/symfony/comments/1izrt2g/from_laravel_to_symfony_day_1/)

# 1. Dependency Injection & the Service Container

I have to admit—Symfony’s DI is incredibly powerful. It offers a level of flexibility that I’m not sure I’ll ever fully utilize. However, it’s always better to have more capacity than to hit limitations down the road. One feature I particularly like is "tags", which allow you to “hook” into different parts of Symfony’s internals in a structured way. Laravel also has tags, but they serve a different purpose—mainly for grouping items together for later resolution from the Container.

While reading Symfony’s documentation on DI, I finally understood why Laravel’s **Service Providers** are named that way. The concept of “services” in Symfony aligns with `services.yaml`, where almost everything is defined as a service. However, in Laravel, Service Providers—despite their `register` and `boot` methods—seem to have evolved into a mechanism more focused on configuration and initialization rather than DI configuration itself.

That being said, Laravel does provide ways to handle flexible dependencies as well, just in a different way:

services:
ServiceA:
arguments:
$myVariable: 'value of the variable'
--- vs ---

$this->app
->when(ServiceA::class)
->needs('$myVariable')
->give("value of the variable");

Another interesting difference: Laravel’s container creates a new instance each time by default, unless explicitly registered as `singleton` or `instance`. Symfony, on the other hand, follows the singleton pattern by default, meaning it creates an instance once and reuses it.

Also, Laravel doesn’t rely on DI as heavily as Symfony does. Many dependencies (especially framework-level ones) are accessible via Facades. And just a quick note—Facades in Laravel are NOT some proprietary invention; they’re simply a design pattern that Laravel adopted as a way to access container-bound services. You’re not forced to use them—you can always rely on constructor injection if you prefer.

# 2. Simple vs. Complex Solutions

One key difference I’m noticing is the contrast between simplicity and flexibility (with complexity) when solving common problems in both frameworks. For example, this “Laravel code” (to get list of all the users): `User::all()` where, under the hood, many distinct things are happening:

* Connection Management
* Query Builder
* Data Mapping (Hydration)
* Data Value (attributes and “casting”)
* and, Pagination logic (if used as `User::pagiante()`).

From one side, it might not seem like the “right” approach (because it's not SOLID**!**), on the other side, do you need the flexibility (and complexity, or at least “extra code”) Symfony goes with just to get the list of users? Symfony, requires more setup—going through a repository, entity manager, and a custom pagination solution (or an extra package). So, the way I see it - Symfony enforces a structured, explicit approach, while Laravel prioritizes convenience (1 line vs many classes).

Another example would be Laravel Queue vs. Symfony Messenger. Laravel’s queue system is practically plug-and-play. Define a job, dispatch it, run a worker. Done. Of course, extra configuration is available. Symfony’s Messenger, on the other hand, is more low-level. It’s incredibly flexible—you can configure multiple buses, custom transports, envelopes, middleware, and stamps, etc.

>So, is it flexible and powerful enough? - Definitely.

>Do you need this flexibility (and complexity)? - It depends.

So far, I’m leaning
toward this statement:

* Laravel is an excellent choice for small to medium projects that need quick setup, an MVP, or a PoC. It provides a strong out-of-the-box experience with sane defaults.
* Symfony is ideal for long-term projects where you can invest time (and budget?) upfront to fine-tune it to your needs.

\---

Also, I would like to ask the community (you) to define “magic” (referred as "Laravel magic"). What exactly do you put in this meaning and definition so that when I work with those frameworks, I could clearly distinguish and identify “magic moments”. Because, it feels like there are some things that I could call “magical” in Symfony too.


Thanks.

https://redd.it/1jaf2lt
@r_php
I created an open-source app to browse laravel's new community starer kits!

Hello everyone! So I discovered a few hours ago that laravel now allows for custom community starterkits!

Thanks to the team for that btw! I am not sure if they are planning on making an app to browse these or not in the near future, so I figured, why not do it myself lol

You can find the link here:
Laravel Starterkits Gallery

(I will probably buy an actual domain if there is actually demand)

This is VERY early in development btw, there are a lot of features I want to add (again, if there is enough demand).

Roadmap

You can find the github link here: https://github.com/AndryTafa/laravel-community-starterkits

Disclaimer: This is very much into early development, so if there is any bugs, or maybe crashes, please bear with me lol

If you have any feedback, please feel free to DM me, and feel free to contribute! (However, I will firstly add a roadmap to the readme, so if you would like to contribute, you could have a look at the things I will want to work on)

I would appreciate a star :P

Any feedback is appreciated. thanks!

https://redd.it/1jaedi2
@r_php
Is there a tool for visualization?

Does anyone know if there's a website for visualization for PHP that shows the process what's happening when your run a block of code?

https://redd.it/1jaarqd
@r_php
Statamic CMS as rest-api endpoint for big data

Hi guys, I'd need to create a ecommerce rest-api and looking for a ready to use cms..
Anyone ever used statmic as a rest-api based cms? Any feedbacks?

I know there are some lacks of functionalities, like in-built auth or different collections for different tables, can it be a good idea as a rest-api (with around million records) ?



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