@doefom@mastodon.social
@doefom@mastodon.social avatar

doefom

@doefom@mastodon.social

I’ve been a web developer for years now and built tons of stuff in the web. Most of it I never finish but when I do, I get 0 users 👍

Laravel, Statamic, Livewire, Tailwind, Alpine

This profile is from a federated server and may be incomplete. Browse more on the original instance.

doefom, to Laravel
@doefom@mastodon.social avatar

Macros are one thing I enjoy using the most in . It's a way to extend the functionality of many built-in by providing custom callbacks for a specific key.

One production example I use macros for fairly often is what I call the "admin alert". Especially in smaller applications I want to get notified whenever an error or an event occurs the admin (mostly that's me) should know about.

Here's what this might look like.

doefom,
@doefom@mastodon.social avatar

@emd what’s an action class?

doefom,
@doefom@mastodon.social avatar

@emd thanks for the offer! Do you know a GitHub repo where this is used and I can take a look at?

doefom,
@doefom@mastodon.social avatar

@emd that's great! Have never heard of it but it looks like a super useful concept. Thanks a lot!

doefom, to Laravel
@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, to php
@doefom@mastodon.social avatar

#PHP 8.4 introducing "Property Hooks". This means you will be able to hook into the default read and write behavior of your class properties. The design also allows for more hooks in the future. Really looking forward to this one!

Read more about this feature in the RFC:
https://wiki.php.net/rfc/property-hooks

doefom, to Laravel
@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).

doefom, to php
@doefom@mastodon.social avatar

After the last few things I've learned about 8.4 by accident I thought why not look into it and see what else there is. So, here's an example of the four new rounding modes PHP 8.4 will introduce to the 'round' function:

  • PHP_ROUND_CEILING
  • PHP_ROUND_FLOOR
  • PHP_ROUND_TOWARD_ZERO
  • PHP_ROUND_AWAY_FROM_ZERO

I rarely use anything else than 'ceil' and 'floor' in my daily work but this is still good to know.

What do you think?

doefom, to Software German
@doefom@mastodon.social avatar

What’s the best piece of #software you use in your daily work as a #laravel developer?

doefom, to webdev
@doefom@mastodon.social avatar

Do you know the tags 'details' and 'summary'? I didn't until now.

The combination of those two let's you toggle content with default HTML behavior. This is one of those things you will probably not use in production because it just doesn't look so nice but as always, for quickly prototyping something like an FAQ section this might just fit in perfectly.

image/png
image/png

doefom,
@doefom@mastodon.social avatar

@lyokolux Nothing and you’re absolutely right! I just don’t like the little arrow, it looks a bit „old“ I think but that definitely is not a deal breaker for sure. Maybe you can even change the arrow? Don’t know

doefom, to webdev
@doefom@mastodon.social avatar

Here's another interesting tag. <mark> lets you highlight certain parts of your text to draw extra attention to it.

One real world example where this can be especially useful is highlighting the parts of your search results that match the search query. Or at least that's where I regularly use it.

Any more ideas on where this might be useful?

image/png

doefom,
@doefom@mastodon.social avatar

@shaedrich that’s a great use case indeed, thanks!

doefom, to random
@doefom@mastodon.social avatar

I wish jQuery was still a (modern) thing. Enjoy using it ever since, basically started my career as a paid developer using it. Guess there's some nostalgia left. I feel like each website out there has at least one problem where the $ would be an easy fix. I need a jQuery hoodie

doefom,
@doefom@mastodon.social avatar

@shaedrich hahaha I‘ll take what I can get 😁

doefom, to Laravel
@doefom@mastodon.social avatar

Does Google index my web application when using #Laravel with #inertiajs (no SSR)? I read articles that say it doesn't, I read articles that say JS is no longer an issue for Google. What's true? Or can there even be a clear answer here?

doefom, to random
@doefom@mastodon.social avatar

I've worked on a new release of my 'restrict' addon for @statamic. Since v0.4.x you can define which entries should be listable to whom in the control panel by defining your custom restriction logic. Bring your own permissions, only show entries that belong to the same company as the user and what not.

However, my approach on achieving this still feels a bit shaky. So feel free to take a look at the repo and bring in your thoughts. Every hint is appreciated!

https://github.com/doefom/restrict

doefom, to webdev
@doefom@mastodon.social avatar

Recently a friend of mine pointed me towards HTTPie, a currently free Postman alternative which feels quite similar but less bloated. Also, besides the desktop app they've built a CLI client supporting form submissions and what not which is super fun to use. I personally prefer working with UIs in most cases but judging from GitHub with 32k stars as of today there might be some folks that feel a little different about the CLI topic.

Check it out here: https://httpie.io/

#webdev

doefom, to webdev
@doefom@mastodon.social avatar

Just published a new release of one of my addons. But first I rewrote the whole thing, then updated the README, noticed that half of my code is not necessary, rewrote the whole thing, then updated the README again. That's how I work.

doefom, to webdev
@doefom@mastodon.social avatar

Oh man, there are so many tags I didn't know about. One of those is the <abbr> tag that can be useful when working with abbreviations. Here's a short example.

image/png

doefom, to Laravel
@doefom@mastodon.social avatar

By default #Laravel will wrap your json resources in a 'data' key. The '::withoutWrapping()' method lets you disable this behavior.

You can turn this off for all resources extending the JsonResource class or just for specific ones, that's up to you.

#webdev

doefom, to Laravel
@doefom@mastodon.social avatar

I think in English when you write formal text you spell the numbers until 10. From there on you just write the number. can help with that using the 'Number::spell' helper.

doefom, to Laravel
@doefom@mastodon.social avatar

TIL that #Statamic ships with the 'isCpRoute()' function, which allowed me to make my code a little more compact. The function will check if the current route is a control panel route or not. Here's the old and new code. Feels refreshing 😁

#Laravel #PHP #refactoring #webdev

doefom, to php
@doefom@mastodon.social avatar

Right now all my #php packages have 855 downloads in total. Which compared to other packages is like nothing. But 1000 people downloading and some of them still using my open source work is a cool feeling. Will pop open a beer once I reached my first 1000

doefom, to Laravel
@doefom@mastodon.social avatar

The last few days I've shown some examples of how I use macros in #Laravel for certain classes in my daily work. In case you enjoy using macros as much as I do, here's a list of some popular and frequently used classes that implement the Macroable trait that you might not yet have on your radar.

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