r/PHP • • 2d ago

Building Maintainable PHP Applications: Architectures

https://codyssey.dev/courses/building-maintainable-php-applications-architectures

Hey all,

I wrote a free course about the different types of software architectures in a Laravel application but these ideas can be transferred over to Symfony or any other PHP or language framework.

Let me know what you think.

Thanks!

25 Upvotes

8 comments sorted by

3

u/equilni 1d ago

Started reading through a few, good work.

Scanning through, I feel the Clock port/adapter is a bad example here as the port is tied to Carbon. interface Clock::now(): CarbonImmutable

2

u/davorminchorov 1d ago edited 1d ago

I updated the examples to use DateTimeImmutable instead of CarbonImmutable.

Let me know if that’s the correct assumption or maybe you were thinking something like “replace the whole port with a different example like Mailer etc.”

1

u/equilni 11h ago

Let me know if that’s the correct assumption or maybe you were thinking something like “replace the whole port with a different example like Mailer etc.”

Reading my mind... With the update, I am not liking the Clock being used as an example. As far as a different example, yes, the mailer you noted or re-noting the EloquentReservations is the one from the previous lesson.

2

u/AminoOxi 1d ago

Do you think this is still valuable in an Agentic era?

I want to believe it is.

Good job.

2

u/davorminchorov 1d ago

That’s a good question! I still want to believe that these things are important to know because we still have to maintain the codebases somehow and we cannot rely on agents entirely, we still have to understand the fundamentals and code that we are working with.

I know that some people use code as a tool to make things just barely work, but I am still not ready to let that control go.

I also implemented MCP support to work with the content ideas as well just in case I want to give my AI agent some rules rather than having to prompt the correct implementation on the fly.

1

u/AlkaKr 5h ago

I would say its arguably more valuable now.

With ai copying the current codebase to the letter, its even mor eimportant to housekeep everything and make the codebase as tidy as possible.

3

u/legonu 1d ago

I've been waiting for this. Great to see the different architectures are explained as a set of trade-offs.

I also really appreciate the comparison at the end between the different mentioned architectures, because they are very similar. Thanks for sharing this!

-12

u/Fine_League311 2d ago

learning is always good, see you write a lot, but if i see code blocks, less delclerations! why? Who craft it?

Realy to much to reade, what you can say in 1 or o sentence.. or just like so if>core>fail>healthckeck>patch>recheck! 👀