Douglas Smith (@dascentral) header
Douglas Smith (@dascentral) profile picture

Technologist, Laravel enthusiast, aspiring photographer

Arlington, VA
Joined May 2007
Photo by Douglas Smith (@dascentral)Photo by Douglas Smith (@dascentral)Photo by Douglas Smith (@dascentral)Photo by Douglas Smith (@dascentral)Photo by Douglas Smith (@dascentral)
Even in a world of AI-powered tooling where we can build features from the dentist's waiting room, I still value the quality and polish of @laravelshift when upgrading a Laravel app. Thanks for getting me to Laravel 13 so smoothly, @gonedark.
1
2
3
693
Douglas Smith retweeted
🔐 Something people have wanted for a long time in Inertia.js is a way to force a page to reload when navigating through history. The primary motivation is to prevent someone from seeing pages in history after logging out of an app. Right now, if you sign out of an Inertia app and then go back in your history, you'll see the previous pages as they were when you visited them. This is just how the browser's history state works. Yes, you can close your tab or even close your browser to end that session — but most browsers still allow reopening recently closed tabs, giving you access to that previous history state. Unfortunately, browsers don't provide any APIs for clearing records out of history state — it's just not possible. Since Inertia.js saves each page visit in history state, which includes all the page props (your data), it's possible for someone to go snooping through your history if you're on a public or shared computer and didn't use an incognito window. Even if we got creative and added a flag to prevent end-users from restoring pages from history, a hacker could easily still access the data via the `history.state` property. Well, @joetannenbaum and I have been trying to find a solution to this in Inertia.js v2.0. It's been a journey. We've explored all kinds of approaches to solve this — like storing the history state in localStorage, sessionStorage, IndexedDB, an in-memory cache, etc. While these storage mechanisms allow for clearing data, they all have other issues — for example, storage limits. Turns out you can store a lot in history state, and honestly, that's where we want to store this data. That's where the browser expects you to put it! But we just can't clear it out. So, how do we solve that? Well, I think we've found a way! Using the web crypto APIs, we're able to automatically encrypt the Inertia page props into history state. Then, we save an encryption key in the browser's session storage and use that to decrypt the page props when navigating through history. However, and this is the important part, you can choose to delete this key from your session storage! When you do this, it automatically invalidates all your previous history entries — they can't be decrypted. When Inertia can't decrypt a history entry (because the key has been rotated), it automatically loads a fresh copy of the page from the server — meaning if you've logged out of your app you'll be automatically redirected to the login page. We're still working out the exact APIs, but enabling prop encryption will be something you do server-side. For example, in a Laravel app, you'll be able to add the `inertia:encrypt` middleware to the routes you want encrypted. (And yes, you can mix encrypted and non-encrypted routes!) To clear history state on logout (or whenever you want), you can use the `Inertia::clearHistory()` method, which will instruct Inertia client-side to rotate the encryption key. It's remarkable how quick the encryption and decryption are — most of the time it takes 1-2ms. It's so fast that we almost considered just having this enabled by default all the time. We're still testing this out, and there's definitely a chance we hit a roadblock that invalidates this whole idea, but as of right now I'm optimistic that this might just work! 🤞
36
47
10
502
40,292
It’s incredible what the Laravel community is doing for web development. Kudos @enunomaduro, and thank you.
pinkarmy, assemble! we’re proud to announce that @PinkaryProject is fully open source 🤌🏻
1
3
2,234
Douglas Smith retweeted
🎉 We've been cooking up some pretty exciting things recently for Inertia.js v2.0 — @joetannenbaum has literally rewritten a decent chunk of the core router to accommodate some new features we're adding. One big goal for v2.0 is to improve the background data reloading and polling story, and I'm so pumped to share what we've come up with 🙌
39
41
16
393
40,698
Douglas Smith retweeted
Okay call me a noob, but I just had a life-changing experience with PHP. I installed Laravel, then Laravel Jetstream, and then Laravel Spark. After ~2 minutes of configuring, I have a dashboard, a fully working Stripe integration with users, teams, 2FA, and API auth. WHAT?! 🤣
201
152
70
2,354
559,828
Introducing Laravel Pulse. 💓 Pulse delivers at-a-glance insights into your production application's performance and usage. Track down slow jobs and endpoints, find your most active users, and more. Next week on GitHub. A gift from Laravel to you. pulse.laravel.com
128
467
96
3,029
240,888
Remember to enable "Less secure app access" when using Google's SMTP server to send email in your @laravelphp app. (Any app, really.) Otherwise, you'll receive a "Username and Password not accepted." That toggle lives within the Google account settings: myaccount.google.com.
48
🎉 I'm excited to announce that screencasting.com is live! It's everything you need to know to create beautiful screencasts quickly. • Content planning • Gear recommendations • Recording tips • Editing workflows I've poured so much into this, I hope you love it!
64
112
53
659
475,725
I forget how awesome AppleScript is sometimes. This little script (hooked up to Raycast) completely cleans my desktop for recording. • Hides the menu bar • Hides the dock • Hides my messy desktop icons
9
3
56
TIL about enforcing data structures within MySQL JSON columns.
📽️ Working with JSON columns in MySQL? JSON columns are really flexible, but sometimes you want a few more safety features. Fortunately, you can enforce a schema on that column to ensure that your JSON always has the right shape!
5
I'm excited about this one. 🙌🏼
This is going to be an *awesome* addition when working with the Laravel Notion API. 😍 It will make working with your Notion databases much faster and easier, since it looks and feels like Laravel Eloquent - which is, as we all know, just magic ✨
This is an amazing value add to @laracasts.
I'm happy to announce that we've worked out a deal with @reinink to offer his excellent and massive "Eloquent Performance Patterns" series to all Laracasts subscribers. The first two episodes are up now, and we'll add more every week until it's complete. laracasts.com/series/eloquen…
Douglas Smith retweeted
The evolution of a PHP object from PHP 5.6 to PHP 8.2: quite the difference! 🤩 youtube.com/watch?v=x9bSUo6T…
21
236
39
916
I hope you are all strapped in for when Laravel's Vite plugin drops. @jessarcher has sweated over the tiniest of details to make sure this thing is absolutely golden. 🚀 Ya keen or what?! 🚀
10
11
2
134
This super exciting new feature is now officially released, as a part of Valet 3! To update: 1. Update your global Valet constraint to "^3.0" 2. Run `composer global update laravel/valet` 3. Run `valet install` 4. Party On, Wayne! github.com/laravel/valet/rel…
I've spent every evening for the last week reviewing & re-working a huge @laravelphp Valet pull request that adds a really cool feature: You'll be able to "isolate" any given site to be served by a specific version of PHP, regardless of Valet's global PHP version. Coming soon!
25
39
24
192
🔥 #Laravel Tip: If your app needs to record logins and logouts for security purposes (auditing), then you should definitely make use of the auth events, which allow you to easily listen for them.
23
130
11
617
Douglas Smith retweeted
Laravel Collections tip. To remove all falsy values from the collection, simply call filter without any arguments ✨
4
25
3
74
Just found out there's a single artisan command to clear out all Laravel caches, much less typing!
17
116
15
580
Douglas Smith retweeted
“1Password now includes full support for SSH keys, providing the easiest and most secure way for developers to manage SSH keys and use Git in their daily workflow.” blog.1password.com/1password…
9
36
5
244