Come find me on Вӏսеskу — @ cmorrell.com

Philadelphia, PA
🦋
2
8
2,800
Like the idea of UUIDs in #Laravel models, but hate the giant, hyphen-separated strings? I'm about to release a new implementation of Snowflake IDs that give you globally-unique, ordered, numeric IDs. (Same as what Twitter and Discord use.)
14
54
370
48,836
There's so much more that I want to eventually open-source, too. Like check out this beautiful date-picker…
14
8
256
Oooh. Just hit a UUID collision.
38
11
258
How many times a week do you dump a model in #laravel and then have to scroll down to the attributes and expand them? laravel-dumper brings the model attributes to the top of the dd() output for easier debugging.
19
10
197
31,021
Introducing `glhd/linen` — lightweight spreadsheets for Laravel. We've been using this code internally for a while and I finally decided to break it out into a package. It's dead simple, with minimal configuration and a low memory footprint. Check it out…
10
33
171
14,542
And here's the current API. The wizard now supports Laravel-style rules for each step! 🔥
2
22
150
Alright. I just tagged the first stable pre-release of Laravel Dumper: github.com/glhd/laravel-dump… Just `composer require` and instantly get improved `dd()` and `dump()` output for most Laravel core classes (like Models, Query Builders, the Service Container, etc).
7
30
145
One of these days I'm going to get around to the 1.0 release of this universal address input component…
7
6
133
17,004
Hoping to launch the 0.1 release of Dawn by early next week!
7
12
131
I find that 90% of the the time, the @laravelphp commands that I write follow the exact same pattern: - Query some data - Perform some operation on each row Internally, we have a trait that simplifies this immensely. I'm working on open-sourcing it right now.
11
12
133
Imagine a world where you could use `x-rules` in @Alpine_JS with @laravelphp-style validation rules and get browser-native errors… 👨‍🍳
8
7
132
11,326
I'm so excited about the release of #Laravel 9. A bunch of folks have outlined the major highlights of this release, so I want to take a second to talk about the few contributions I've made and why I'm excited about them! 👇
3
20
124
The fact that I can create such a flexible custom @Alpine_JS directive in ~10 mins is just incredible.
5
9
139
24,522
My new favorite custom @tailwindcss utility.
4
13
116
I'm excited about this one! I just submitted a #Laravel PR that would add support for markdown views! github.com/laravel/framework…
7
8
108
11,763
90% of my console commands follow the same process: 1. Grab data (usually from the DB) 2. Process that data row-by-row Our `glhd/conveyor-belt` package makes it so nice to write those commands, and comes with dozens of convenience features. Just released version 2.0!
2
14
104
16,764
Alpine.js is so so so good.
5
3
97
12,644
PSA: If your PHP Github Actions build is failing right now, it's because the psr extension was (accidentally?) added to o the very popular setup-php action. You can fix it by adding ":php-psr" to your extensions list.
11
32
98
24,625
Thinking about adding another custom Blade directive to our app. Thoughts?
4
2
79
10,128
So excited about the new Query Builder contract in Laravel 9. Can't wait!
1
14
78
I had a really ugly nested loop that I needed to call in a few places. Abstracted it away to a generator, and the code feels so much better…
5
7
81
9,984
Is `Str::snake` not EXTREME enough for you? Introducing, `Str::extremeSnake` 🧨🧨🧨🧨 (Gist incoming…)
4
3
76
6,352
Just watched @JustSteveKing, @brendt_gd and @bobbybouwmann talk about #Laravel structure on @laravelnews… If you want a nice balance between the "standard Laravel structure" and a more domain-oriented approach, check out `internachi/modular` ✅ Split logic into isolated modules, but each module follows the standard Laravel structure ✅ Code generators and auto-discovery *just work* ✅ Tests live in modules, so they're not 100% colocated, but are organized by domain ✅ It's just Laravel + composer. Modular provides a tiny bit of glue to make it work and then gets out of your way.
3
8
72
21,939
I don't think enough people know about `base_convert` in PHP. It's a neat tool if you need to squeeze something like an ID into fewer characters. Here's a fun example: generating unique 11-character slugs for a URL shortener.
2
11
73
11,388
Imagine you could wrap any part of a #Laravel template in a special blade component and have that content immediately editable without any other changes… 😎
7
4
71
13,386
Folks were talking about prefixed ULIDs in response to my Snowflake post the other day. This is just a guess, but I think something like this would work:
4
1
73
18,307
What it's like on Вӏսеskу right now…
10
17
73
20,811
TIL about `whereMorphedTo` in #Laravel Eloquent… It handles both a model class or a specific model! ❤️
1
14
63
7,861
I'm so glad I put cmorrell.com/php-fpm together… I end up referring back to it every time I need to re-configure php-fpm.
4
12
63
4,954
Nice… got a working `x-wizard` @Alpine_JS directive. Here's the markup for this demo: gist.github.com/inxilpro/c1a… I'm going to clean up a bit more and try to publish next week.
1
9
56
Alright. I just tagged version 0.5.0 of Laravel Dumper, with Laravel 9 support and a minor change to how custom casters are registered. I plan on tagging the first stable release in a day or two unless any bugs turn up. github.com/glhd/laravel-dump…
6
55
So I've been thinking about putting together a talk about maintaining the same PHP app for 25+ years. Is this something folks would be interested in? If so, are there any particular questions that you'd like to have answered?
5
1
55
3,933
I've seen a bunch of people talking domain-oriented #Laravel structure lately. I'd encourage folks to check out `internachi/modular`… Modular lets you stick to Laravel conventions, while still breaking your app into logical chunks.
5
10
55
11,779
I know that there are reasons for this, but the fact that I can't grab @tailwindui examples in Blade/Alpine really sucks. I know @calebporzio has talked in the past about wanting to make this happen. I would 100% pay extra for this.
14
3
54
12,983
This is promising. Imagine HMR for @laravelphp
2
7
56
I find myself using named regex capture groups way more often lately. Rather than having to remember that `$matches[2]` is the domain, I can just use `$matches['domain']`!
2
4
53
9,235
Alright. I'm not quite ready to tag 1.0, but I'm pretty sure this is the locked API… special✨ lets you use enums to access specific database records—think of it almost as eloquent-backed enums. I'd love some feedback before I commit to 1.0! github.com/glhd/special
5
4
56
10,492
Want the simplest way to add breadcrumbs to your #Laravel app? Check out glhd/gretel — configure breadcrumbs directly in your routes, and display them with accessible markup (w/ support for most major UI frameworks).
5
4
50
7,539
Want to register your own `dd()` customizations? In the latest laravel-dumper release you can do just that. github.com/glhd/laravel-dump…
4
8
53
Coming soon to @phpstorm: @Alpine_JS support! I just submitted the first working version to @jetbrains so hopefully it'll be live in a few days.
6
3
54
Alright. Tagged the first version of @​glhd/alpine-wizard just now! Check it out: github.com/glhd/alpine-wizar… Try it on CodeSandbox: rchy.net/3QrgQq4
1
11
49
PHP x NYC has started!
4
1
47
2,101
I think about custom relationships in #laravel all the time, and I just had a new idea that I may explore. I'm curious, though—does something like this look appealing to other people at all?
9
3
49
12,412
You can easily build a feature-rich app with just Laravel. Right now, you can’t with just Remix. That’s the difference. React can benefit from a Laravel backend. Laravel can benefit from a React front end. They’re technologies that go *great* together. But if I had to choose only one to build a real app that I expect people to pay to use, I know which one I would pick…
A better way to say this is: If Rails and Laravel are so “full stack”, then why is everyone writing their frontends with React?
5
3
42
19,352
Tinkering with an @Alpine_JS wizard directive, and having a little trouble naming things. We need to know when each step applies and when it's done. I don't love `x-wizard:done` — anyone have a better name?
8
1
42
Now that we're not scrambling, I want to take a minute to acknowledge all the amazing work that went into getting the disaster check-in site live. At 4pm on Sunday, @DCoulbourne found a pocket of internet service and posted an idea to the Verbs discord: A phone number that people affected by Hurricane Helene could send updates to via SMS, and a website that their friends and loved ones could use to check for those updates. A group of nearly a dozen devs immediately jumped on it. In the middle of a move, @johnrudolphdrex helped write up tickets, and by 4:30 a landing page was up. By 5:30, basic SMS logging was working. By 6, the first UI was built. At 7, we realized that Twilio approval could take weeks, but 3–4 people were already tapping contacts to see if we could expedite things. Over the rest of the night, a flurry of PRs came thru putting everything in place, and at 1am I got an email saying that Twilio was trying to expedite the request. The next morning everyone jumped right back in, and while we were waiting for Twilio we improved the UI and added additional features. Eventually, @francoxavier33 offered us a pre-approved number for use. The site was live! Daniel was able to get a local radio station to broadcast the number that evening, and while the team was working to continue to improve the site, 33 people checked in via SMS. Twilio approved the original phone number — (828) 888-0440 — later that night, and we've been promoting it all today. So far we've had 70 check-ins and ~2,000 unique visitors to the site. People are checking it… now we need to get the number out to as many folks as possible. Anyway, it was a pretty amazing thing to be a part of. Thank you so much @Hanslts, @gcavanunez, @ShengSlogar, @prymiee, @ProjektGopher, @MaybeEdward, @ryanhefner, @skylerkatz, and all the other volunteers on the Verbs discord whose Twitter handles I don't have. It's so cool to see this number of (relative) strangers work so well to make this happen so quickly!
3
11
41
2,502
OK, I just made the repo public for my *very* early @linear SDK for PHP/Laravel. It's built on top of Saloon by @carre_sam and @spatie_be's laravel-data package, so you get a ton of functionality out-of-the-box. All data is built directly from the GraphQL definition, so the entire SDK is fully typed using the latest definitions from Linear. There's still a bunch I want to do before I tag a release, but I just wanted to share my progress!
6
4
41
4,287
This is a cool approach to SEO-friendly routing! One way to level this up even further would be to use hashids to generate URL-friendly suffixes that map 1:1 to your primary keys. Something like…
📹 Generate self-healing URLs with Laravel! piped.video/watch?v=a6lnfyES… (And throw exceptions that render as HTTP redirects 🌶️)
3
2
39
12,455
Alright. I just tagged the first pre-release of Dawn: github.com/glhd/dawn 1.0 is a ways off, but what's there is representative enough that I'm OK posting about it. TODO: 🔲 Finish Dusk-compatible API 🔲 DX improvements 🔲 Docs 🔲 Cross-platform testing 🔲 Lots of cleanup
4
10
38
I feel like a static "qualify" method on your eloquent models is a huge quality-of-life improvement as soon as you need to do complex joins or subqueries…
3
4
40
4,919
In our app, we have the concept of a "record locator." Here's an example: BB1-1KO-E1EJO5 From this string I can get: - The model class - The model ID - The date that model was created - The "owner" of the model if it has one Is this something other people would use?
11
36
Registering resource routes with #Laravel and Gretel is so freaking nice… github.com/glhd/gretel
1
10
36
TIL about stream wrappers in PHP… They let you register your own URL protocol with PHP for use with fopen/fwrite/etc. It turns out I don't need to use one, but it feels like something that you could have some fun with…
4
2
38
1,519
Just built a very cool internal artisan command. We have a daily scheduled task that takes a snapshot of our production database, anonymizes it, and exports it to a S3 bucket. No we can just run `php artisan dev:setup` to quickly import those dumps locally whenever needed!
1
1
36
Having a lot of fun building the navigation UI. Another pretty complex set of interactions made possible thanks to @Alpine_JS ❤️
1
1
35
So much better…
2
1
36
My wife and I just got dressed up to go out to dinner and see a concert. 10 mins after the babysitter was supposed to get here (and she’s ALWAYS on time), my wife asks, “you scheduled her for tonight, right?” Turns out not only did I not text the babysitter, but I also never bought the concert tickets! So instead of seeing Josh Ritter, I’m whipping up last-minute dinner for the fam 😭
10
32
14,350
It seems like this would be relatively simple to add to #Laravel belongs-to relations. `orderByRelation` would be a lot trickier to do on other kinds of relations, though. Is this something folks would use if I PR'd it to the framework?
2
4
34
2,822
Holy smokes Filament is really good.
7
1
33
2,179
In our app we don't actually store prefixed IDs, but we do provide a version of them to end-users. We use "hashids" to convert regular auto-incrementing IDs to non-sequential alphanumeric IDs. You could then easily prefix those if you wanted…
Folks were talking about prefixed ULIDs in response to my Snowflake post the other day. This is just a guess, but I think something like this would work:
1
1
32
6,786
For folks who didn't have the privilege of watching @DCoulbourne's announcement at @LaraconAU: check out the Verbs docs at verbs.thunk.dev — they're still a work in progress, but they should give you a good sense of what Verbs is about!
3
26
9,714
This poor kid was just venting because he doesn’t know how to use PHP, and look what he got himself into…
2
30
1,696
Also, isn't the Verbs logo (by @NateGio) amazing!?
5
3
26
7,078
All of this with just…
2
4
30
2,012
5/11 Next: In Laravel 8, a validation error would result in a 𝚅𝚊𝚕𝚒𝚍𝚊𝚝𝚒𝚘𝚗𝙴𝚡𝚌𝚎𝚙𝚝𝚒𝚘𝚗 with the message: "The given data was invalid." In Laravel 9, instead you'll get a message like: "The first name field is required (and 2 more errors)" 😍
1
30
Replying to @tomschlick
I'm in a trollish mood… teddit.net/r/PHP/comments/13…
6
1
28
4,863
Has anyone tried to make Vercel for #Laravel? Like, just point it to a Laravel repo and you have a site? Forge is great, but requires managing servers. Vapor is great, but is expensive for hobby projects. Fly is close, but every time I’ve used it it has NOT been seamless…
12
2
27
12,801
Wild. I merged a couple of PRs this morning and now Verbs is almost at 30 contributors!
2
28
2,126
Does anyone have a favorite APM service for #Laravel apps? We're considering New Relic and Datadog, but I would love something less excessively enterprise-y if possible.
24
1
30
21,484
I've had an idea for a #Laravel-related podcast for a while… I wanted to sit down and really think thru topics that I bump into somewhat regularly, but never feel important enough to really "get right." Introducing… overengineered.fm/ Just published episode 1!
7
6
29
3,575
All-in-all, I'm very happy with where the API for @​glhd/alpine-wizard landed. Check it out! github.com/glhd/alpine-wizar…
2
3
27
Tinkering with mapping pennant features to enums. What do you think? Yea or nay? (Could extract a lot out to a trait if we start using this regularly.)
10
1
28
3,551
Alpine is the spiritual successor to jQuery in all the good ways. Literally every site that's not built fully in JS should probably be using Alpine for sprinkles of interactivity.
Ok so I tried @Alpine_JS for something more than an hello world, and I'm hooked
4
28
2,782
When event sourcing is appropriate, it can feel like magic. I just built an internal expense tool, and thinking about processes (verbs) rather than moments in time (nouns) was so so much easier. When @DCoulbourne launches Verbs at @LaraconAU I hope more folks get to enjoy this!
1
4
28
3,771
"Oh, it'll be a quick and easy feature" I said… "Oh, I'll just knock it out on the train" I said…
1
28
1,375
Here's a fully working Dawn browser test, using a stock @laravelphp installation with jetstream and @LaravelLivewire. I had to nail down a couple of bugs, but Dawn is starting to feel more and more solid!
1
2
26
OK, I think I just had a moment of genius. The one thing that's annoying about using @tailwindcss components is when you want to provide a default value that can be replaced by a custom value if necessary. I'm tinkering with a "default" modifier that could solve that.
5
4
23
So a couple days ago I posted about something that I couldn't share for privacy reasons… I just recorded a version where I cut out the parts that I couldn't show, so that I CAN show the interesting parts as a developer… I basically built a test generator that uses real Stripe webhook data to generate the tests. We start by picking a real user who is in the state that we want to test. The code grabs all the associated data, anonymizes it, and creates Eloquent factory calls. We then interact with the app, performing the actions we want to test. Each time I hit enter, it groups all the webhooks I triggered and creates calls to our Stripe webhook controller with that payload. When I'm done, I have a fully mocked test stubbed out—I just add the assertions in between the webhook calls. I dunno if this gets the magic across, but I thought I'd try…
3
1
26
3,612
Alright. Anyone want to kick the tires on spatie.cards before @freekmurze shares it with thousands of people on Wednesday? 😬
4
4
25
Hey all. I just wrote a blog post. It's kinda long, so I'm going to summarize it in a few tweets. Twіttеr is bad now. For those who have dismissed Mаstοdоո, I'd love it if you at least look at the next few tweets with an open mind ❤️
3
8
24
10,794
Replying to @shrutibalasa
I've been using porkbun for a while and they're pretty good. The prices are competitive and they offer things like free whois privacy, which is nice.
3
26
6,542
OK, I take it all back. I was feeling bad for this dude, assuming he was new to PHP and just over his head, but if you’ve been using PHP for 6 years and haven’t figured out the tooling yet, that’s on you…
3
1
22
6,898
TIL if you type "edit" in a #laravel tinker session, it'll open your editor to write out a multi-line code block. Very cool.
1
3
27
2,203
Bought it on pre-launch. Bought even more of it on launch. Unlimited lifetime = no brainer.
🥳 Welp, Flux is HEREEEE! 🚀🚀🚀 Flux is a UI component library for Livewire 🎁 26+ components 💅 Modern design 🌬️ Styled with Tailwind 🤖 Custom, lightweight, JS core ⌨️ Accessibile components @ashugeo and I have given this project everything we've got. Hope you dig it 🔥
1
1
26
3,704
FIRST GREEN!
3
26
3,917
Now that it's my sole responsibility to keep @calebporzio's feed full of useful code tips, here's another! 😂
1
1
25
2,102
Train boarded. Secret project started! I’ll be meeting @DCoulbourne in about an hour and we have 72 hours to get a working package together…
2
23
1,473
Can't wait until PhpStorm gets a taste of my new macbook… 😛
6
21
2,717
Replying to @ryanflorence
I maintain an IntelliJ plugin (phpstorm/webstorm/etc) that gives you a lot of it: plugins.jetbrains.com/plugin… (I’ve also heard rumors that the amazing Laravel Idea plugin is going to add additional Alpine support soon, too!)
1
24
3,712
Conveyor Belt 0.2.0 is out: a major refactor to add support for many more data sources. Get the features of Conveyor Belt (step mode, exception handling, debugging, etc) when you need to process big CSV or Excel files or import data from JSON sources! github.com/glhd/conveyor-bel…
1
2
23
Another neat little trick I learned today… Combining `json_encode` and `json_decode` with PHP's SimpleXML extension gives you a quick-and-dirty way to convert XML to a PHP array! It doesn't handle lots of more complicated XML structures, but does the trick for simple ones.
3
3
22
3,355
The @ThunkDev pyramid scheme really lets you know who your friends… and who your enemies are. The event log doesn’t lie.
2
1
22
1,289