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
Backup laravel mail Sender

Is there a way to have a bacup mail Sender, example: my main sender returned some kind of error, so the app tries to send in another one.

I did some research and find nothing about it.

https://redd.it/1k4efo7
@r_php
Laravel but static?

A while back I did this small static site using jigsaw plus some simple form handling in php. It worked fine, wasn't my favorite to work with, and I kept thinking I should just have just gone with insert framework here behind cloudflare with some aggressive caching... But something something sunk cost lets just keep going.

Fast forward maybe 6 months, and I see the static pages feature in tempest and I have a "yeah that makes perfect sense, why didn't I think of that" moment.

So since I already have a bunch of blade templates for this site I decided to see what it would take to get static pages in laravel. Simpler than I expected...

https://github.com/ssnepenthe/mostly-static

It's a bit rough around the edges and I doubt I will spend much time improving it/cleaning it up. But I thought I would share in case anyone else finds it useful as a starting point for doing something similar.

https://redd.it/1k4tnzl
@r_php
Have very small PHP/MySQL/HTML project, not sure best place to post it

I've looked at /phpjobs and /forhire and not sure the best place to post a request. I see some other websites, like Upwork, as well. But my project is pretty small and self-contained and I want to find a reliable freelancer.


Short version is that I have a website, six pages, with some read-only MySQL calls. I programmed it myself back in 2008, and hired a designer for the look and feel. I have work to do on the website (broken links, old information), but before I do anything I need to bring the PHP up from 7.3 to current 8.4. I haven't programmed anything in years and don't have the head for it anymore (I manage teams in a mainframe iSeries environment). So I need someone to review the code and update any decremented commands, and there are two widgets that no longer work, which probably have common solutions.


So this is a small project, maybe 10-15 hours, with no follow-up projects. I will post more information in a real "for hire" post, but right now not sure where is best to post it to get the right freelancer.

https://redd.it/1k4t64f
@r_php
TALL stack + Filament = Built an invoicing app in under a week

Hey everyone,

I’ve been working with Laravel for over 10 years now, and honestly, with the TALL stack and Filament, building things has never been easier. I have been using excel 😅 to generate invoices for years and it occurred to me that I can build something with Livewire to generate and manage invoices.

Thought I’d try putting something together with Filament + Livewire, and within a week (just a few hours a day), I had a working app. It might be useful for some of you as well.

Check it out: **plaininvoice.com**
No signup or anything—just a clean way to generate and download invoices.

https://redd.it/1k4x64t
@r_php
My Career Plan: Specializing in WordPress and Beyond

I want to specialize deeply in WordPress — and only WordPress. That means I won’t follow any other PHP frameworks anymore. My goal is to be able to build any type of system using WordPress just the way I envision it.

For example, I want to be capable of creating custom themes, booking systems, movie ticket reservations, food ordering platforms, online course platforms like Udemy, and more — all powered by WordPress.



Besides that, I also plan to study Node.js and Vue.js (or React.js), as well as technologies like Docker, Redis, Kafka, Message Queue systems, and design patterns.



So, if I follow this path, will I have a stable and promising career in the future?





https://redd.it/1k4xmf1
@r_php
Best Practices for uploads/ Directory Versioning and Filesystem Permissions in Symfony

# Question de support

# Question 1 : Gestion des versions du répertoire uploads/

Faut-il :

Versionner un répertoire `public/uploads/` vide (avec `.gitkeep`) tout en ignorant son contenu via `.gitignore` ? Exemple :/public/uploads/\ !/public/uploads/.gitkeep
Ou y a-t-il une meilleure solution pour s’assurer que le répertoire existe après le déploiement ?

# Question 2 : Autorisations du système de fichiers pour uploads/

Est-ce que ces approches sont recommandées ?

1. Utilisation des ACL (préféré) : \`\`\`bashHTTPDUSER=$(ps axo user,comm | grep -E '\[a\]pache|\[h\]ttpd|\[\_\]www|\[w\]ww-data|\[n\]ginx' | grep -v root | head -1 | cut -d\\ -f1)Pour var/ (cache + logs) et uploads/

sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads

Question de support
Question 1 : Gestion des versions du répertoire uploads/
Faut-il :
Versionner un répertoire public/uploads/ vide (avec .gitkeep) tout en ignorant son contenu via .gitignore ?
Exemple :
/public/uploads/

!/public/uploads/.gitkeep



Ou y a-t-il une meilleure solution pour s’assurer que le répertoire existe après le déploiement ?
Question 2 : Autorisations du système de fichiers pour uploads/
Est-ce que ces approches sont recommandées ?
Utilisation des ACL (préféré) :
    Pour var/ (cache + logs) et uploads/

HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1)
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads
sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads

s

# Support Question

# Question 1: Versioning the uploads/ Directory

Should we:

* Version an empty public/uploads/ directory (with .gitkeep) while ignoring its content via .gitignore? Example:/public/uploads/\* !/public/uploads/.gitkeep
* Or is there a better alternative to ensure the directory exists after deployment?

# Question 2: Filesystem Permissions for uploads/

Are these the recommended approaches?

1. Using ACL (preferred): \`\`\`bashHTTPDUSER=$(ps axo user,comm | grep -E '\[a\]pache|\[h\]ttpd|\[\_\]www|\[w\]ww-data|\[n\]ginx' | grep -v root | head -1 | cut -d\\ -f1)For var/ (cache + logs) and uploads/

sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads

Support Question
Question 1: Versioning the uploads/ Directory
Should we:
Version an empty public/uploads/ directory (with .gitkeep) while ignoring its content via .gitignore?
Example:
/public/uploads/*
!/public/uploads/.gitkeep



Or is there a better alternative to ensure the directory exists after deployment?
Question 2: Filesystem Permissions for uploads/
Are these the recommended approaches?
Using ACL (preferred):
bash
For var/ (cache + logs) and uploads/

HTTPDUSER=$(ps axo user,comm | grep -E 'apache|httpd|_www|www-data|nginx' | grep -v root | head -1 | cut -d\ -f1)
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads
sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX public/uploads

2. User/Group Permissions:
- Should the webserver user (e.g., www-data) and deployer user be in the same group?
- Example setup:
      sudo usermod -a -G www-data deployer  # Add deployer to www-data group
sudo chown -R deployer:www-data var/ public/uploads/
sudo chmod -R 775 var/ public/uploads/ # RWX for owner/group, RX for others

2. **User/Group Permissions**:
- Should the webserver user (e.g., `www-data`) and deployer user be in the same group?
- Example setup:
bash
sudo usermod -a -G www-data deployer # Add deployer to www-data group
sudo chown -R deployer:www-data var/
public/uploads/
sudo chmod -R 775 var/ public/uploads/ # RWX for owner/group, RX for others


https://redd.it/1k539wi
@r_php
Pre-RFC Associated Types

Posting this on Reddit, because why not.

A few weeks ago, motivated by the RFC about allowing never as a parameter type, I started writing a proof of concept for "Associated Types" which are "generics"/"template" types limited to interfaces as they do not have a lot of the complexity relating to generic types on concrete classes, as the bound type can be determined at compile time rather than run-time.

Internals email post is: https://externals.io/message/127165

PoC on GitHub is: https://github.com/php/php-src/pull/18260

https://redd.it/1k571ns
@r_php
Large/enterprise inertia examples

Looking for some large-enterprise level inertia projects as I’m interested in seeing what different design patterns others are using in their projects. I lead a very small development team so don’t get a lot of exposure to well written large scale Laravel code.

I’m assuming most of the good stuff will be private, so if anyone is open, I’d be happy to pay consulting cost/sign whatever to run me through it.

Otherwise if anyone knows any good public gh repos?


https://redd.it/1k5u80p
@r_php
I've never extended a class or used the protected function.

Hi all,

Edit: I program in OOP. At least I think I do? Every new tool has a class, view and controller. I include classes I reuse over and over again such as database class.

I've been trying to diversify my knowledge and fill in gaps as I've been at my current company 5 years and have self taught a lot of the knowledge I have regarding PHP and full stack dev work. I've never really found a use case for extending classes or sub classes but I generally follow an MVC structure.

Could someone link me a case study for using these techniques as when I look it up and see the explanation I still struggle to apply it to my daily work. I also have an innate feeling that being self taught I'm lacking a lot of knowledge that might come in useful later down the line.

Or perhaps something thats like a codex of whats industry standard coding in php backend these days?

https://redd.it/1k61910
@r_php
Livewire Starter Kit

I know this sounds petty but it’s kinda sucks that if you want the rest of the UI elements, you need to pay for it. I know folks worked hard on it but at this point, I thought Laravel would bring out their own at least.

Anyone sign up for Flux UI? I think I might bite the bullet.



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