Andrea Pozza
3.7K posts

Andrea Pozza
@andreapozza_
La vita è meravigliosa... senza sarei morto.
Milan, Lombardy Katılım Ocak 2011
169 Takip Edilen218 Takipçiler

@MrPunyapal @PovilasKorop Probably not so easy to get if still building the query or not
English

@MrPunyapal @PovilasKorop I feel this! Having dd() show SQL on a Model instance feels wrong. Wouldn't it be better to add a dd() method directly to the Model class to prevent it from forwarding to the query builder?
English

@MrPunyapal Is the method coming out of the box or it's a custom scope?
English

Hey @aarondfrancis, any updates on the future of FusionPHP? Still one of the most exciting concepts in the ecosystem. Would love a quick status check! ⚡️
English

@furiouswhopper @magadum_aniket I partially agree. A local scope would help, User::whereNullOrEmpty('middle_name')->get(). Even better, cleaning the database if possible.
English

@andreapozza_ @magadum_aniket The SQL that this generates is a million times clearer and easier to read than this is. Shoving all of the operators randomly into variables, llambda params, and function names is crazyyyy
English

Hey Laravel Developers 👩💻
Even after working with PHP and MySQL for so many years, I often find myself forgetting this scenario in MySQL.
So whenever you query based on whether a column is null in a table, always remember that this won't include any empty strings, as an empty string and null values are two different data types in MySQL.
So, if you are working with Laravel and there is a possibility of a column being an empty string as well, always add a conditional for the same, as shown in the code snippet below.
#laravel #php

English

@furiouswhopper @magadum_aniket Standard Query Languages have conditionals too and can become hard to read as well 😁
English

@magadum_aniket If only there was a standard language for queries that we could use instead of this ugly chained query builder hackery...
English
Andrea Pozza retweetledi

@MrPunyapal I know people who know JQuery without knowing JavaScript
English

@_newtonjob What frustrates me here are those invokable controllers 😄
English

@Ogumons No. I don’t see how can possibly work.
How does the proxy identify the user?
How does know which routes must be ratelimited if you don’t implement it at Laravel.
How does it even know whether or not a request should be counted against the rate limit?
This isn’t generic stuff
English

@magadum_aniket #method-once" target="_blank" rel="nofollow noopener">laravel.com/docs/12.x/help…
QME

Hey PHP Developers 👩💻
Here is a quick, small tip when working with classes in Laravel.
Sometimes in a class, you might have a method that does a long task and may be called multiple times in a web request.
In that case, you may create a property on the class itself and cache the result there so that we won't compute the method again and again.
A very simple trick indeed, but maybe very useful if you want slight performance upgrades.
You might see this pattern being used at multiple places across the Laravel Framework.
#laravel #php

English

@_newtonjob Personally, I like prefix boolean attributes with `is_`.
Anyway, the custom builder seems to be the only option if you don't want to rely on old syntax.
English

Vitest: Visual Regression Testing in v4 👀
Yes, you read correctly! @vitest_dev has a new `toMatchScreenshot` functionality that enables visual regression testing right in your favorite testing framework
Available from v4.0.0-beta.4 on.
More in the PR!
github.com/vitest-dev/vit…
English

@PovilasKorop I always go with `foreignIdFor`.
This way, the relationship between entities is quite obvious, and I let the framework handle the rest.
English

@ralphschindler @taylorotwell @calebporzio Oh, I get it now. Probably too much freedom on how to build makes you wondering if the way is right when coding. I always do
English

@andreapozza_ @taylorotwell @calebporzio I understand that.
The default skeleton has Volt components, blade components, flux components, a views/livewire directory, partials.. The layouts can't be Volt components. There is still an App\Livewire\Actions\Logout, which seems out of place. Hard to see what the vision is.
English

When it comes to quickly prototyping a front end with no fuss or headaches I swear Laravel + Volt + Flux by @calebporzio has to be the fastest stack in the world.
English












