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
PHP 8.4 brings CSS selectors :)

[https://www.php.net/releases/8.4/en.php](https://www.php.net/releases/8.4/en.php)

RFC: [https://wiki.php.net/rfc/dom\_additions\_84#css\_selectors](https://wiki.php.net/rfc/dom_additions_84#css_selectors)

**New way:**

$dom = Dom\HTMLDocument::createFromString(
<<<'HTML'
<main>
<article>PHP 8.4 is a feature-rich release!</article>
<article class="featured">PHP 8.4 adds new DOM classes that are spec-compliant, keeping the old ones for compatibility.</article>
</main>
HTML,
LIBXML_NOERROR,
);

$node = $dom->querySelector('main > article:last-child');
var_dump($node->classList->contains("featured")); // bool(true)

**Old way:**

$dom = new DOMDocument();
$dom->loadHTML(
<<<'HTML'
<main>
<article>PHP 8.4 is a feature-rich release!</article>
<article class="featured">PHP 8.4 adds new DOM classes that are spec-compliant, keeping the old ones for compatibility.</article>
</main>
HTML,
LIBXML_NOERROR,
);

$xpath = new DOMXPath($dom);
$node = $xpath->query(".//main/article[not(following-sibling::*)]")[0];
$classes = explode(" ", $node->className); // Simplified
var_dump(in_array("featured", $classes)); // bool(true)

https://redd.it/1iw1q94
@r_php
Feedback needed - new package (LarAgent)

Hey! I recently released a new package which aims to simplify AI Agent development in Laravel. Please check it out: https://github.com/MaestroError/LarAgent

The docs aren't fully finished yet, but there is pretty enough to get some insight, install and try it out.

Your ideas and suggestions are crucial. Any feedback will appreciated!

https://redd.it/1iw6b7a
@r_php
Is API platform the best choice for building a REST API?

Hey everyone,

I’m currently working with Symfony and wondering if API Platform is the go-to solution for building REST APIs these days. I see a lot of recommendations for it, but I’m curious whether it’s truly the best approach for modern API development.

For those who have used it:

How does it compare to a manually built Symfony API with controllers and services?

Does it add unnecessary complexity, or does it streamline API development significantly?

Is the learning curve steep, or is it worth investing time in mastering?


Would love to hear your thoughts and experiences!



https://redd.it/1iw9r13
@r_php
Hosting recommendations with supprt

Hi i am on Forge, and its worked so well, but right now I have the dreaded the site cant be reached error on Chrome,It got me thinking is there a good host that I can get live chat support with, so if an error happens like this I can get it fixed quickly?

Just wanted to see if you guys know of any hosts that has live chat support, like cloudways? Thanks

#

https://redd.it/1iwcbuh
@r_php
Is it a sin to use brackets when importing multiple classes?

Example:

<?php

namespace App\Filament\Resources;

use App\Enums\{CourseStatus, RegistrationStatus};
use App\Http\Controllers\CourseController;
use App\Models\Course;
use App\Filament\Resources\CourseResource\Pages\{ListCourses, ManageCourse};
use App\Filament\Resources\CourseResource\RelationManagers\RegistrationRelationManager;
use BezhanSalleh\FilamentShield\Contracts\HasShieldPermissions;
use Filament\Forms\Components\{DatePicker, DateTimePicker, Placeholder, TextInput};
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Resources\Resource;
use Filament\Tables\Actions\{Action, EditAction};
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Filters\{Filter, SelectFilter, TrashedFilter};
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon;




https://redd.it/1iwd662
@r_php
Weekly /r/Laravel Help Thread

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.

For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the r/Laravel community!

https://redd.it/1iwg55g
@r_php
Ae you bullish on Laravel?

Howdy r/Laravel!

As the noscript states, I’m curious about the fine folks here opinion of the future of Laravel in terms of community and job security. TL;DR at the end, but to summarize the massive wall of text below, I’m a .NET/TS dev looking to make the jump to Laravel/PHP.

Some background:

I’m coming up on almost a decade of employment as a professional developer. The majority of my time has been spent in .NET, Java, and JS/TS. I’ve even had a brief stint working on embedded systems, and have worked up and down the stack, from the frontend down the depths of DevOps and databases.

The last four or five years of my career, I’ve been primarily working in the Microsoft™️ stack, and to cut a long story short, I’m growing fairly disdainful of it as the days go on. Everything these days just feels so… Microsoft-y. Don’t get me wrong, I love C# as a language, but I’m burning out on the typical way over engineered enterprise-y apps that I work on that have been hacked on by thousands of devs over the years to create an amalgamation of absolute code chaos.

I picked up PHP and Laravel about two years ago while on paternity leave to learn something new and keep myself sane. That quickly grew into an obsession and I’ve been spending damn near all of my spare/open source time writing PHP. Small utility packages, Laravel side projects and libraries, and even small business websites around my town with Statamic. I’ve been watching every Laracon talk and trying to be somewhat active in the Laravel communities on Discord/X/Bluesky.

I’ve been loving the solo builder/entrepreneurial spirit of Laravel and its ecosystem, identifying more with its community and general sentiment that that of .NET. In essence, I’m all in on Laravel.

I never took a “real” chance at Laravel jobs until recently, and after punching out a few applications, I have a pretty good response rate so far and have some interviews lined up. I’ve been pretty picky about the jobs I’ve been applying too as I can’t afford to take a pay cut at the moment being the sole breadwinner between my wife and I. I’ve noticed that PHP/Laravel salaries tend to be a good bit below the .NET/TS market for developers, and I’m nervous about taking a jump if the opportunity presents itself to side step (pay-wise) into a Laravel role.

I have an opportunity with a company that seems pretty cool and tapped into the Laravel community. My nervousness is kicking in though as I’ve only been at my current company for about 9 months, a gigantic F500 with a mega old legacy monolith that I was baited to working on. The promise was working on newer microservice-based stuff, but that hasn’t come to fruition and is not looking likely in the near future. Pile on a metric shitload of red tape and bureaucracy, and I’m basically a well paid code janitor at the moment. It’s done nothing but accelerate my growing annoyance of .NET and its surrounding ecosystem.

With all that said, I’d love to get the community’s opinion(s) on Laravel and PHP, from past, present and future. Do you feel like the growing momentum Laravel has had over the past few years will sustain? In your opinion, what’s the outlook of PHP and Laravel over the next few years?

Thanks everyone!

TL;DR - I’m a TS/.NET career sellout and want to transition into Laravel/PHP. I have an opportunity to do so, but I’m getting cold feet.

https://redd.it/1iwp0o4
@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/1iwtfg5
@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/1iww2wk
@r_php
Tempest alpha 5 is now released with PHP 8.4 support, improved console styling and components, Vite support, and much more
https://tempestphp.com/blog/alpha-5/

https://redd.it/1iwwytz
@r_php
Laravel Cloud - Hype train "woo woo!"

Anyone else super hyped for the Laravel Cloud release today? Can't wait to be a Guinea pig :-)

https://redd.it/1iwzzwi
@r_php
New Laravel website. First impressions.

First impression ? Bad.
After re-evaluation? Fu*king horrible.

Hijacked scroll, you need to scroll 5 times to move out of a section.
Page down to navigate? Good luck, you will "miss" information that's only visible after you "scroll" a specific section of the page.


Mobile ? I am not even going to start here.

Disc: This is my opinion and does not reflect the opinion of any of my peers.

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