Recent Activity
Here's what @tomgobich has been up to this past year
-
-
Upvoted comment Thank you for your work @tomgobich
-
-
Upvoted comment Thank you so much for your work !
-
Published news Saying Goodbye to Adocasts Plus
-
Published news What's New in AdonisJS - Week of May 31, 2026
-
Published lesson Understanding by Doing, Clean Slate
-
Published lesson Sign Up & Securing User Passwords
-
Published lesson Sign In & Sign Out Flows
-
Published lesson Using the Authenticated User
-
Published news What's New In AdonisJS - Week of May 24, 2026
-
Published lesson Query Builder Basics
-
Published lesson Working with Model Relationships
-
Published lesson Pagination
-
Upvoted comment Hey Tom, thanks for this new series, it's helping a lot !I am...
-
Replied to Hey Tom, thanks for this new series, it's helping a lot !I am...
Hey @cgregoire! Glad to hear it's helping!
I wouldn't really call that an issue, per say, but you're correct. Like many things, just because it's a solution doesn't mean it's a good solution for all use-cases. If your application is going to need a combination of UUID, int, etc IDs then a blanket matcher for all IDs isn't a good option. If, however, your IDs are all normalized to one type, like integer values, then it will fit the bill just fine!
Good call on the
ul, that could definitely go within theelseto prevent the emptyulfrom being added!Thank you for taking the time to provide feedback!! I appreciate it!
-
Published lesson CRUD Basics
-
Published lesson Factories & Seeders
-
Published lesson Database Migrations
-
Published lesson Models, Schema Classes, & Relationships
-
Published lesson Middleware & Grouping Routes
-
Published lesson Sessions & Flashing Messages
-
Published lesson Components, Layouts, & Partials
-
Published lesson Form Basics, Method Spoofing, & CSRF
-
Published lesson Validation & Flash Storage
-
Published lesson Route Names & Type-Safe Route Generation
-
Upvoted comment So is the "Forever" plan being phased out completely or will...
-
Replied to So is the "Forever" plan being phased out completely or will...
My plan, at this time, is to bring it back as an option once I'm done with my break.
-
Replied to discussion Default front-end stack for the default adonisjs project
Both the now outdated Let's Learn AdonisJS 6 and the in-progress/updated Let's Learn AdonisJS 7 series focus on EdgeJS instead of React or Vue. By using EdgeJS, we can focus fully on what AdonisJS has to offer and not alienate folks who prefer either Vue or React, as this series is meant to be an introduction to AdonisJS and not Vue or React.
EdgeJS is a server-side template engine like Blade is for Laravel and Razor is for .NET. With AdonisJS you can easily use React or Vue either via Inertia, an in-app SPA, or a separate decoupled application.
-
Published lesson Route Parameters & Matchers
-
Published lesson Controllers, Barrel Files, & Subpath Imports
-
Upvoted comment Ah, 7 is out! How hard is it to upgrade our v6 project to 7?...
-
Replied to Ah, 7 is out! How hard is it to upgrade our v6 project to 7?...
Yep, sure is! 🙂 Should be relatively quick and easy! The core team has even provided AI agent instructions, if that's your sort of thing. You can find that along with all the upgrade instructions here: https://docs.adonisjs.com/v6-to-v7.
I don't have any upgrade instructions of my own nor have I upgraded any of my packages at this time, unfortunately. I've been putting all my resources into making this series as good as I can get it!
-
Published blog post The Road Ahead & A Brief Break
-
Published lesson Defining Routes & Rendering Views
-
Published lesson View State & Passing Data to Views
-
Published lesson EdgeJS View & Tag Syntax
-
Upvoted comment Oh yes, I was actually mixing up encryption with signedUrlFor...
-
Replied to Oh yes, I was actually mixing up encryption with signedUrlFor...
So, you should reach for a database stored token over a Signed URL when:
You need instant revocation. If you're granting access to an operation one-time and that limitation is important, then Signed URLs aren't a good option. Might be single-use access to a file or something like password resets.
You need to track usage. Like limiting how many team invites an organization can send
You need long lived access. If you're granting access to something for a month, for example, having that in the db would be a safer bet as time increases the likelihood something will need to change.
If those three things don't apply, chances are a Signed URL will work just fine. The benefit of Signed URLs is that they're easier and quicker to implement and scale much better for heavy traffic URLs since they don't need to hit the database. If you have the time and resources and you're unsure which to use, there's nothing wrong with playing it safe and using db-driven tokens.
I appreciate the offer, but at the moment I'm currently only working on the Let's Learn AdonisJS 7 series. I'm planning on taking a brief sabbatical once that's completed. I'll have a blog post soon going into more detail 🙂
-
Upvoted comment I recently discovered AdonisJS, and it immediately caught my...
-
Replied to I recently discovered AdonisJS, and it immediately caught my...
That's awesome to hear, @ricardo-fortis! I hope you enjoy AdonisJS and find these lessons helpful. If you have any questions are you go through them, always feel free to ask. Happy to help!
-
Replied to I'm glad I waited till v7 to learn adonis, I've been following...
Yeah, definitely sounds like you're going to really enjoy the improvements v7 brings with it then! :D
My pleasure! Thank you for watching, and I hope you enjoy @julius-emmanuel-oyigocho!!
-
Published lesson Introducing AdonisJS
-
Published lesson Dev Environment & Text Editor
-
Published lesson Lifecycle & Project Structure Tour
-
Published lesson Meet the Ace CLI
-
Published lesson Environment Variables
-
Published lesson Creating A New AdonisJS 7 Project
-
Replied to I’ve been wondering about something for a while: Why use Adonis...
Hi @gregory! By encryption tokens, are you referring to Signed URLs? Where you generate a cryptographic signature that's attached to a URL you're sending.
If so, you're spot on with your final point. The purpose of Signed URLs is merely to prove the request is authentic and hasn't been tampered with. The only power you have to revoke a Signed URL is an expiry that's set when the URL is generated. If revocation is a requirement, that's where you'd want to use something like a database stored token tied to the user.
If, instead, you're talking about the actual
encryption.encrypt()andencryption.decrypt()methods those actually do utilizenode:cryptounder the hood. For example, the AES-256-GCM driver for AdonisJS 7 usescreateCipheriv,createDecipheriv, andrandomBytes. This was similar in AdonisJS 6 as well.Additionally,
string.generateRandom(), used in this lesson to generate the database stored password reset token also usesnode:crypto'srandomBytesmethod to create a cryptographically secure random string. That method originates from Poppinss.Hope that helps! If I misunderstood, please do let me know!!
-
Upvoted comment Glad you find it helpful! Here is a Reddit topic with some...
-
Replied to Glad you find it helpful! Here is a Reddit topic with some...
Thanks a bunch for sharing!! I'll give it a read through!! 🙂
-
Upvoted comment Thanks! I ended up doing this before reading your post. I’m ...
-
Replied to Thanks! I ended up doing this before reading your post. I’m ...
Anytime!! The solution you arrived at looks great! Since you're within an action, you could pluck that section out into a private method to separate concerns a bit and give that section of code a name. Completely optional though, either way works just fine!
@inject() export default class SendPasswordResetEmail { constructor(protected rateLimiterService: RateLimiterService) {} async handle({ payload }: Params): Promise<SendPasswordResetResult> { // ... try { await ipLimiter.consume(ipKey) await emailLimiter.consume(emailKey) const result = await this.#rotateResetTokens(payload.email) if (result) { PasswordResetRequested.dispatch(result.user, result.token) } return { status: 'sent' } } catch (error) { if (error instanceof errors.E_TOO_MANY_REQUESTS) { return { status: 'rate_limited' } } throw error } } async #rotateResetTokens(email: string) { return db.transaction(async (trx) => { const user = await User.query({ client: trx }).where('email', payload.email).first() const { token, hash } = generateTokenAndHash() if (!user) return null await RevokePasswordResetTokens.handle({ user }) await CreatePasswordResetToken.handle({ user, hash }) return { user, token } }) } }Copied!Oh, please don't feel silly for missing it! I don't mind helping in the slightest, I like to link to the docs and even internal code when I know of it just to give more sources and context. I know having additional examples always helps me, and it might help someone else who stumbles across these comments at a later time as well.
My pleasure, @gregory!! Anytime! 🙂
-
Upvoted comment Hi @tomgobich I’m having trouble handling transactions after...
-
Replied to Hi @tomgobich I’m having trouble handling transactions after...
Hi @gregory! I've got good news, transactions cascade through relationships. It seems like everything here is stemming from your user, so you should just need to attach it to your user and Lucid will do the rest!
await db.transaction(async (trx) => { user.useTransaction(trx) await RevokePasswordResetTokens.handle({ user }) await CreatePasswordResetToken.handle({ user, hash }) })Copied!It looks like you're good here with what you have, but just as an additional note of something to be mindful of. Managed transactions rely on the exception being thrown to know whether something failed. So when using transactions across methods/actions like this be sure to be mindful about
try/catchstatements you may add down the road. -
Upvoted comment Adonis seems great so far. Adocasts is also quite great. They...
-
Replied to Adonis seems great so far. Adocasts is also quite great. They...
Thanks a bunch for taking the time to right out this helpful and thoughtful constructive feedback, @yavor-kirov!! I greatly appreciate it, and it comes at a great time as I'm in the process of preparing the next iteration of this series for AdonisJS 7, which is releasing soon.
I'll definitely take this into consideration and focus more on why using AdonisJS is awesome and how it saves time and resources! 😃 Thanks again!!
-
Replied to Yeah other videos are working, although I haven't gone through...
Very strange, I'm terribly sorry about the issues! Extensions can cause the strangest issues, but I would expect other videos to be having issues as well if that were the case.
Switching this series from our old video provider to our home grown solution is on my to do list. I'll go through this introduction module today and get it switched over. That should fix up whatever is going on with this lesson! Apologies for the inconvenience!!
-
Replied to Video isnt showing, seems broken
Hi Julius! Sorry to hear you're having troubles with the video. It seems to be working okay over here. After inspecting our logs, it looks like your request might've been missing the info required for our DRM. I've got a request for this video without any of the needed DRM info shortly before your comment came through. Are other videos in this series working for you? And, are you using a browser or any extensions that might alter our player in any way?
-
Published lesson The Browser Client
-
Published lesson Testing Browser Form Submissions & Validation Feedback
-
Published lesson Authentication in Browser Tests
-
Replied to Since releasedAt is nullable in the Movie model, the Edit action...
Good catch, thanks for sharing @adun! Apologies I missed that!!
-
Upvoted comment Thanks for the help. I think there were several things I had...
-
Replied to Thanks for the help. I think there were several things I had...
Anytime! Awesome, I'm super happy to hear you were able to figure it out and get it up and running! Issues like these can be kind of hard to help with from afar.
You should be able to get at your app's log to see the exact error by SSH'ing into your server and running
pm2 listto find the id of your app. Then, you can dopm2 show <id>to see where its logs are being stored and use vim to read them. -
Upvoted comment I built and ran it locally and I get ERROR (7830): Failed to...
-
Replied to I built and ran it locally and I get ERROR (7830): Failed to...
Just gave this a go locally on a new Inertia app and I get "Failed to load url inertia/app/ssr.ts" when I have
NODE_ENV=development. The Inertia entrypoint is different between development and production. In production mode it'll be./build/ssr/ssr.js. SettingNODE_ENV=productionshould fix that up so its looking in the correct spot for the build.I'm not getting the rollup options error though, but that sounds like it might just be because the SSR file couldn't be found and I have a hunch changing the
NODE_ENVshould fix that up as well. If, for any reason it doesn't, please share yourvite.config.tsfile! There might be a hint in there. -
Published lesson The Auth Plugin
-
Published lesson Testing Auth Protected Routes
-
Published lesson Testing Authorization with Bouncer
-
Published lesson Piecing It All Together
-
Upvoted comment I will double check the node versions, but it seems ctx.auth...
-
Replied to I will double check the node versions, but it seems ctx.auth...
Yeah
ctx.authis coming throughundefinedwhen it should be the authenticator, even when a user isn't logged in. So, something is causing it to be misconfigured on production but not locally. A difference in Node version is one possibility. Double-check that the packages needed for authentication@adonisjs/auth,argon2,bcrypt, etc are all installed as dependencies and not dev dependencies, that's another possibility.Attempting to follow your deploy build pipeline locally should help pinpoint the issue, especially if you're able to replicate the issue locally because then you can step through it with the debugger or console logs to see what is having troubles.
Oh - also make sure your
NODE_ENVwithin your environment variables is set toproduction! I've seen that cause some weird issues before. -
Replied to discussion Prod Deployment
Hey @aaron-ford! What's the error message you're getting?
If it works fine locally but not in production, then the answer probably lies in a difference between those two environments, like maybe a different NodeJS version. Try installing the same version you're using in production on your local machine. Then build the project for production locally and attempt to run it to see if you're able to.
-
Upvoted comment Thanks for your help, everything makes sense now. Hopefully ...
-
Replied to Thanks for your help, everything makes sense now. Hopefully ...
Awesome, I'm happy to hear that! Anytime at all, @gregory! 🙂
-
Replied to Just what I was looking for, as Inertia's InfiniteScroll component...
Anytime, @lfjsa! Hope it helped!! 🙂
-
Upvoted comment Hey @tomgobich ! I’ve been watching your videos and checking...
-
Replied to Hey @tomgobich ! I’ve been watching your videos and checking...
Hey @gregory, great question!
For most things, applying the limiter at the route level with an HTTP limiter will likely suffice. Moving the limiter into the controller, service, or action is ideal when you need to:
Do something specific when a user is rate limited.
For example, maybe you want to gracefully handle the response if you don't want the user to lose form state.Do something before applying the rate limiter.
For example, you might use a rate limit to restrict invalid login attempts to prevent someone from trying to brute force the login. In order to know whether a user should be penalized you first need to know if the provided credentials were invalid.
Since HTTP limiters are run before the controller, by moving the limiter into the controller flow you're granted more control over how and when the limiter is applied and also how the response is handled. If you don't need that added control, then using HTTP limiters at the route level is ideal for its simplicity.
Anytime!! Hope this helps!
-
Published lesson Database Test Runner Hooks
-
Published lesson Testing Database-Driven Endpoints
-
Published lesson Testing with Lucid Model Factories
-
Published lesson Testing Model Logic
-
Anniversary milestone Thanks for spending 5 years with Adocasts!
-
Published lesson testing VineJS Validations & Working with CSRF
-
Published lesson Asserting JSON Structures
-
Published lesson Asserting OpenAPI Specifications
-
Published lesson Testing File Uploads
-
Upvoted comment Hello @tomgobich Why not using .preload('user') instead of...
-
Replied to Hello @tomgobich Why not using .preload('user') instead of...
Hi @gregory!
Mostly just boils down to preference in syntax. Either solution here would work just fine and would result in the same number of queries as well! So, using
preloadin this case is a-okay! 🙂 -
Published lesson Functional vs Unit Testing
-
Published lesson Meet the API Client
-
Published lesson Testing GET Endpoints
-
Published lesson Testing Ace Console Commands
-
Replied to Hello @tomgobich Do you think it’s reasonable to build a booking...
Hi @gregory! Yeah, using HTMX for this would definitely be a reasonable option! You could also look into Unpoly; it's like HTMX but takes care of more automatically for you.
React is great if your app requires a lot of state management or interactivity. Things like dashboards, drag-and-drops, multi-step or complex if/else forms can be made easier with something like React because React can send requests to the server on an as-needed basis to persist or fetch data, all while maintaining the same state locally and dynamically updating the view with ease.
HTMX or Unpoly, on the other hand, are only going to have access to the state that is sent on a per-request basis. They are great if your flows are going to be more linear, as that allows your requests, and therefore state, to go through the server.
For example, say you're going on a trip and flying to get to your destination and back. Your roommate plans on staying home. The important things you'll need for your trip get packed into a luggage bag to go with you. Everything else you own stays home, with your roommate. You don't throw those things staying home away, however, because you will need them when you get back from your trip.
In this example, your belongings are state, and your roommate is a different portion of the page that doesn't need updating (maybe you're the form and your roommate is the shell/layout of the page).
React allows you to leave things at home via local state. Without React, everything must go with you (the request) or be thrown in the trash, meaning it won't be there when you get home (the response). You can, however, still use money you took with you to buy extra things to bring home (using IDs to query data from the database, for example).
Without React and without HTMX/Unpoly, everything must go with you or else it'll be thrown to the trash, and your roommate is forced to go with you as well. So HTMX/Unpoly gives you the flexibility to dynamically update specific portions of your page from the server on an as-needed basis, but for those updated portions, they only have access to the info that was sent with the request. Typically, that's form data, query strings, or route parameters. In most cases, this ends up being perfect, and that extra local state management provided by React isn't needed.
If you're using HTMX/Unpoly and there are one-off portions where you need more interactivity or state management, you can always reach for vanilla JavaScript or even a lightweight package, like AlpineJS, to add state and reactivity to your page. This is the exact setup I'm using for Adocasts (Adonis + Unpoly + Alpine). At the end of the day, whether to use HTMX/Unpoly or something like React is a scale. Each requirement can add weight to the scale, and eventually the heft may merit something like React. That could be something as small as familiarity and a tight timeline.
If you are leaning towards React, there's an integration with AdonisJS to help blend the two together called InertiaJS that will help make it less daunting as well.
If you're really early on in your journey, I'd recommend just making your app with AdonisJS first, using traditional form submissions. Then, sprinkling HTMX or Unpoly into it. That'll give you a foundation of familiarity before introducing a foreign object.
Hope this helps! ~ sorry my answer got really long
-
Published lesson Testing a Simple Service
-
Published lesson Introduction to Mocks & Dependency Swapping
-
Published lesson Introduction to Fakes
-
Published lesson Unit Testing Event Listeners
-
Completed lesson Testing a Simple Service
-
Replied to Well done very helpful even for adonis 6. Mostly the same, extremely...
Thank you for watching, @niemes! I'm happy to hear you found this helpful for AdonisJS 6 as well! 😀
-
Published lesson Testing Async Code & Exceptions
-
Published lesson Data-Driven Tests with Datasets
-
Published lesson Filtering & Controlling Test Runs
-
Upvoted comment I spent the afternoon making it work with react. @inertiajs...
-
Replied to I spent the afternoon making it work with react. @inertiajs...
Thank you for sharing, @gregory!! I'm happy to hear you were able to get it up and working with React!
-
Upvoted comment Hello Tom, I would like to implement email verification, but...
-
Replied to Hello Tom, I would like to implement email verification, but...
Hi @gregory! Great question! I would opt for redirecting to
/email/verify/sentbecause if the user refreshes the page, with this being a URL of its own, they'll be returned right back to this message. If you were to justreturn inertia.render()this page, if the user refreshes, they'll be shown the registration form again since they aren't logged in withinRegisterController.store. That might cause them to question if they actually registered, resulting in them attempting to register again. -
Upvoted comment The R2 way worked, did you face any issues with their egress...
-
Replied to The R2 way worked, did you face any issues with their egress...
Hi @onesoni! Yeah, so far so good using Cloudflare R2 for our videos! I've yet to be charged for egress, so zero issues there. Only charge has been on data storage and that didn't start until we went over the 10GBs you get for free.
-
Published lesson Making Assertions
-
Published lesson Naming Tests
-
Published lesson Group & Test Lifecycle Hooks
-
Published lesson Why Bother Testing?
-
Published lesson The AdonisJS Testing Stack
-
Published lesson Our First Test
-
Published lesson Running Tests with the Test Runner
-
Completed lesson Why Bother Testing?