Discussion and News Abot the Laravel Framework

doefom,
@doefom@mastodon.social avatar

When developing applications I'm always a little afraid of sending emails to actual customers or placing real orders by accident. So I came up with a habit that works super well for me and maybe this will suit you as well.

In my /config/mail.php I add a 'developer' email address and ensure in my AppServiceProvider all emails are sent to this address when in non-production environments no matter what. Makes me build and test stuff way more confidently 😁

Is there a better approach?

doefom, (edited )
@doefom@mastodon.social avatar

@rolfdenhartog That's a great solution, thanks! For such cases I usually work with Laravel Herd. However, many times I know my clients work with outlook for example and then I ensure everything looks fine in outlook. But still, your approach in general feels cleaner than adding my code snippet to the service provider.

doefom,
@doefom@mastodon.social avatar

@mmk2410 that's great, thanks! :)

valorin,
@valorin@phpc.social avatar

It's incredibly common to find hardcoded domains used for identifying admins, however this also makes it trivial to escalate privileges to admin! 😈

https://securinglaravel.com/security-tip-privilege-escalation-through-domain-wildcards/

peach,
@peach@phpc.social avatar

Having a lot of fun with orchestra/testbench for . Took a little bit to get my head around it but getting there.

denniskoch,
@denniskoch@phpc.social avatar

If you are using and experiencing issues with Xdebug not recognizing the correct domain: Go to herd.conf and swap fastcgi_param SERVER_NAME $server_name; with fastcgi_param SERVER_NAME $host;

derickr,
@derickr@phpc.social avatar

@denniskoch Xdebug doesn't care about this — your IDE might though!

denniskoch,
@denniskoch@phpc.social avatar

@derickr Yes. Might have worded that wrong and it's for PhpStorm. But in the end „Xdebug“ won't work“ (in this IDE)

simonhamp,
@simonhamp@phpc.social avatar

If anyone out there is looking to hire developers, I would love to help you find the perfect match

Send me a private message

markusstaab, (edited ) German
@markusstaab@phpc.social avatar

Today I collaborated with ondrey on a fix for which improves a previous performance fix, which caused perf regressions in a edge-case.

The new fix allows a 2-3 seconds instead of 2-3 minutes analysis in all mentioned cases.

Reported issue was https://github.com/phpstan/phpstan/issues/10979

valorin,
@valorin@phpc.social avatar

Securing Laravel has now officially moved to Ghost from Substack! 🎉

I'll be sending out the first Security Tip written on Ghost later today, but first, it's time for a migration discount!

For the next 2 weeks, you can get 25% off a new Securing Laravel subscription! 🎂

https://securinglaravel.com/ghost-migration-discount/

outofcontrol,
@outofcontrol@phpc.social avatar

@valorin Congrats on completing the move!

dunglas,
@dunglas@mastodon.social avatar

Yesterday I learned that it's possible to change the path where apps store uploaded files, caches, logs, etc thanks to the LARAVEL_STORAGE_PATH env var. This is super convenient when distributing apps as standalone binaries using FrankenPHP.

https://github.com/laravel/framework/pull/51243

cooptilleuls, (edited ) French
@cooptilleuls@mastodon.online avatar

Nous avons le plaisir d'annoncer la sortie d'@ApiPlatform 3.3 ! Découvrez avec @soyuka, le release manager du framework, ce que comporte cette nouvelle version :

🖍️ De nouvelles options ajoutées aux classes de métadonnées
✨ Une ouverture sur
🔩 Et plein de nouveautés
https://les-tilleuls.coop/blog/sortie-de-api-platform-3-3

Feedbacks grandement appréciés !
https://les-tilleuls.coop/blog/sortie-de-api-platform-3-3

sirber,
@sirber@fosstodon.org avatar

/ Eloquent looks way easier than / typeorm and / / 😅

Crell,
@Crell@phpc.social avatar

@sirber Pretty good overall, but does have a bit higher curve. If Laravel cribs from Ruby on Rails, Symfony is inspired by Java Spring Boot. When I want a major framework I usually go Symfony.

Crell,
@Crell@phpc.social avatar

@sirber Oh, and on the faux decorators, those are Annotations. Hack to do the in docsblocks.

PHP now has native attributes and basically everyone who matters has switched over to them. Much nicer, natively supported.

pieceofthepie,
@pieceofthepie@n8e.dev avatar

. Put more effort into periodically reinforcing the learning that got you to this point in your career, because at some point you might spend a weekend implementing something from scratch and realising you've literally forgotten it all.

The wheel aren't rusty, they've fallen off.

How does one work with ?
What is a Dockerfile? WTF is Vite?

SamStrong,
@SamStrong@hachyderm.io avatar

@pieceofthepie You can rebuild that knowledge pretty quick though. Your understanding of the underlying structures is still there.

pieceofthepie,
@pieceofthepie@n8e.dev avatar

@SamStrong oh yeah, it took a weekend not months/years.

But still, quite humbling to realise you're essentially back to the drawing board.

pieceofthepie,
@pieceofthepie@n8e.dev avatar

Been battling to get working with rootless all evening and aren't having much luck. Boo to overly complex things.

It's so close to working well but the whole uid/gid mapping thing just falls apart when the container starts running things as different users. All of a sudden there're large parts of my source tree that I can't edit, not to mention being unable to use artisan make tools.

Nitrousoxide,
@Nitrousoxide@mastodon.world avatar

@pieceofthepie
There's a few potential ways to handle userns issues.
The most straighforward one that usually solves it all is to just run the userns as keep-id
https://docs.podman.io/en/latest/markdown/podman-run.1.html#userns-mode

if you do want to keep to seperate uid spaces there's uidmap which gives you a lot of control
https://docs.podman.io/en/latest/markdown/podman-run.1.html#uidmap-flags-container-uid-from-uid-amount

pieceofthepie,
@pieceofthepie@n8e.dev avatar

@Nitrousoxide I ended up going with that first one, but only after I'd moved away from since it was doing something that would stop keep-id from working.

All good now.

doefom,
@doefom@mastodon.social avatar

Using the "Higher Order Messages" of can save you some code. The following examples all filter for published posts in three different ways. I'm not yet sure which way I like the most. Probably (2) and (3).

michael,
@michael@thms.uk avatar

@doefom I don’t like 3. It requires significant mental overhead for me.

My favourite is 2 by a very large margin.

michael,
@michael@thms.uk avatar

@doefom actually I think in this particular instance my favourite would be option 4:

User::where('is_published',1)->get()

😜

j3j5, (edited )
@j3j5@hachyderm.io avatar

Question for my fellas:

Do you think Bus::dispatch()and dispatch() behave exactly the same? Should they?

Boosts appreciated, obviously :)

michael,
@michael@thms.uk avatar

@j3j5 I actually managed to get a PR merged recently, but yeah, you gotta have quite thick skin (and be quite deferential, which doesn’t come naturally to me 😬)

j3j5, (edited )
@j3j5@hachyderm.io avatar

@michael yeah, not my first rodeo and I keep reporting making PRs because I still benefit from them. I can understand from the other side, a repo like that isn't easy to manage, but that's why I try to make the issues and PRs as clear as possible. I think in this case Dries didn't read past the "not 100% sure if it's a bug" 🤷

valorin,
@valorin@phpc.social avatar

Do you use Encrypted Environment files in Laravel?

I think they are great for some special use cases, but given the prevalence of API keys and credentials found in repos, is it worth it to use them all the time?

There was a bit of a debate about this last time I posted it, so I'm curious to see how we're all feeling about them now. Or maybe I'm just being a old security grump? 🧐

https://securinglaravel.com/p/security-tip-encrypting-environment

j3j5,
@j3j5@hachyderm.io avatar

@valorin I don't use them on any of my projects but I do see how they can be useful for a shared local .env

Prod credentials on the repo on the other hand? No way José!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Laravel
  • Durango
  • DreamBathrooms
  • everett
  • magazineikmin
  • osvaldo12
  • Youngstown
  • khanakhh
  • slotface
  • mdbf
  • rosin
  • thenastyranch
  • kavyap
  • cubers
  • InstantRegret
  • megavids
  • tester
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • cisconetworking
  • ngwrru68w68
  • normalnudes
  • provamag3
  • modclub
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines