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
Symfony repo featured on the Temporal Code Exchange

I am pleased and honored to announce that my open source package to get started with Temporal durable workflows and Symfony is now featured on the Temporal Code Exchange.

https://temporal.io/code-exchange/temporal-samples-for-the-symfony-framework

https://redd.it/1kgrnf4
@r_php
Is there anyone one who has ever deployed a Laravel website to Hostinger using shared hosting (not VPS)?

I have been at it now for weeks, and I have consulted multiple AI's, documentation, and I can't seem to get my site deployed to Hostinger, so I am asking here as I am very curious to know if anyone has ever done so? And if so, perhaps you could let me know or point me to a good source where I can get it done?

I know that it's not so straightforward and requires installing lots of Laravel dependencies in the server using SSH access, which I have done, and so I would just be grateful to know if anyone out there has successfully deployed a Laravel site to Hostinger on a shared hosting plan, rather than VPS.

https://redd.it/1kgs48x
@r_php
Job systems

Are there job systems for php, like Sidekiq and SolidQueue are in the Ruby (on Rails) world? I've looked at RabbitMq and Symfony Messenger, with the latter being more what I'm looking for but still not quite the same thing. I'm not using any framework but I am already using some packages from Symfony.

https://redd.it/1kh3ewd
@r_php
Adding User-Selectable Audio/Video Trimming to Filament Forms

Hi folks,

Quick question for the FilamentPHP and Laravel community!

I'm using Filament forms with the Spatie Media Library plugin to handle audio and video uploads for my models. This part works great.

The challenge I'm facing is that I need to allow users to not just upload a file, but also trim it down to a maximum of 10 seconds. Crucially, I need the user to be able to choose which 10-second segment they want to keep from the uploaded file, ideally directly within the Filament form interface.

On the backend, I know FFmpeg is the go-to tool for server-side trimming based on start time and duration.

My main hurdle is the frontend user interaction part. Allowing a user to select a specific 10-second clip typically requires a media player with controls or a waveform/timeline interface in the browser. However, I'd ideally like to avoid building a complex custom frontend component from scratch myself.

Any pointers, examples, or suggestions would be hugely appreciated!

Thanks in advance!

https://redd.it/1khdw5k
@r_php
As someone with PHP already installed locally, I can appreciate when trying out a codebase can be this simple

I have to say I'm proud of how the development environment instructions turned out for Lipupini: https://files.catbox.moe/9wsx68.png

Make sure all dependencies are installed first.

1) Clone the app and cd into the project root

git clone https://github.com/lipupini/lipupini.git


cd lipupini


2) Install Composer dependencies. Composer should automatically create the config file after installing.

composer install


3) Navigate to the webserver document root and start PHP's built-in webserver

cd webroot


php -S localhost:4000 index.php


4) Visit http://localhost:4000/@example

Repository: https://github.com/lipupini/lipupini/blob/demo/README.md#starting-the-php-webserver

https://redd.it/1khftt7
@r_php
How do you avoid "Typed property App\Entity\Address::$street must not be accessed before initialization"?

Hi,

I'm wondering how you handle Entities that have properties that should not be nullable specifically in combination with Doctrine and the FormBuilder.

By default Maker makes the properties nullable. This prevents error like in the noscript but forces you to constantly nullcheck the entity when ever you use it. Also PHPStan seems not happy because the property is nullable but the Doctrine column is not.

Making it non nullable can lead to this not initialized error when you try to call get before you called the setter.

Setting defaults like empty strings and adding NotEmpty assert feels really dirty and will lead at some point to Domain related errors.



https://redd.it/1khonuk
@r_php
For personal projects, Magic Link Emails + Oauth only?

I plan to use a transactional e-mail provider as its extremely cheap to do so these days in terms of a side project/personal project volume (i.e. I probably will be within the free tier to $10/month) so it seems to make sense.

Given how forgotten passwords are basically the same as a magic link, I don't see any real security advantage to using them when I personally am not going to be up to snuff with my career project level security for obvious reasons. One person cannot self code-review for security very well and low interest open source projects are likely to not improve that significantly.

The obvious issue is if they don't use a supported Oauth provider and the e-mails get flagged as spam they might complain/stop using it given the lack of support but since its not financially relevant beyond maybe covering costs I don't see a reason to fix this potential problem. Especially when the same problem happens if they forget a password.

Thoughts?

EDIT:

Obviously, I'd have an expiration time on the links (like 20 min) and the ability to disable them for people who want a better security experience. (i.e. Google Oauth or Discord Oauth is gonna be 100% better than anything I implement anyway)

https://redd.it/1khupev
@r_php
I hate to admit this, but Laravel Cloud is nowhere near production-ready

I moved my app from DigitalOcean droplet(6$) to Laravel Cloud (~80$), a couple of weeks after it was released, and I hate to admit this but I wish I didn’t do that. I was ready to pay more money, thinking that I won’t have to care about downtimes anymore, but it’s actually the opposite.

- Random outages, sometimes up to 20 minutes
- Support replying 24 hours later, no matter the urgency of the issue
- Requests avg. spiking from 200ms to 20 seconds for periods of hours

Don’t get me wrong, Laravel team is awesome, and their products are top-tier, but I wish they’d admit that Cloud is just not prod-ready yet, so developers can make informed choices.

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