Accessing Lucid's Knex Connection Client
Ever need to directly access KnexJS, the query builder Lucid wraps around? Here's how you can do it!
AdonisJS 5 is a NodeJS framework that's comes packed with everything you'll need to quickly build scalable and secure applications or APIs.
Hello folks,
Since I met AdonisJS, I adopted it to be my main framework for building web apps, I would love to thank the team behind it for this amazing work.
Recently, I rediscovered Zed editor, which is the fastest code editor I have ever u...
Read moreHello,
I'm trying to install Tailwindcss plugin but I'm getting an error of "require is not defined".
Here is my Tailwindcss config file
/** @type {import('tailwindcss').Config} */
export default {
content: ['./resources/views/**
...
Read more
I'm just getting started with AdonisJS, I used the web app template, and now I need to add a webhook endpoint, so I can receive events from third-party platforms(such as payments) how can I do that.
Excuse my newbie question.
UPDATE
Fixed it, ...
Read moreSo i have a adonis model where i store propertyValue and each entry has a timestamp (ISO 8601). There are several properties which is related via a propertyId.
So my objective is to aggregate data and get averages over a day for a particular...
I'm using Adonis JS as the API for my application. For each method in my controllers, I add try/catch statements to handle errors and return a response to my front-end in case one occurs.
async createDiscussion({ request, auth, respo
...
Read more
Ever need to directly access KnexJS, the query builder Lucid wraps around? Here's how you can do it!
With AdonisJS 6, layouts have been removed in favor of components. In this snippet, we provide a simple layout component example.
If your server is proxied by Cloudflare, chances are the built-in method to get the user IP Address in AdonisJS is returning Cloudflare's IP instead of your users. With this snippet, we'll fix that!
We can bind handlers to transaction events to easily defer specific actions until after the transaction has been committed and our changes have persisted to the database.
You can use route matchers to specify requirements on the route parameter. In this snippet, we require our username param to start with the @ character for the route to match.
In this lesson, we'll let our users tell us which relationships they'd like to get back in our lesson search. We'll also discuss how to handle nested relationships and what to watch out for.
In this lesson, we'll add the ability to search lessons by their publish date and time. We'll utilize before and after properties to allow for filtering that can look forward, backward, or within a specific date range on our lesson's publish at column.
In this lesson, we'll take the filters we've created thus far and apply them to a new lessons search endpoint. We'll be able to search our lessons by name, status, access level, and module.
In this lesson, we'll make our search course filters optional to increase the reusability of our action. We'll then switch our courses index route handler to use this action.
In this lesson, we'll implement our number filtering system in which we'll allow our search APIs to accept a single number or an array of numbers to filter the data by. To validate this, we'll use the union rule from VineJS.
In this lesson, we upgrade our course name filter to support both simple strings and advanced object-based queries using VineJS’ union rule. This allows users to specify not just what to search for, but how to search for it.
In this lesson, we'll add a new search endpoint for our courses and enable some basic filter functionality along with it. We'll be able to search by course name likeness, status, difficulty, and/or access level.
In this lesson, we'll remove our lesson's index method in favor of a module method whose purpose will be to fetch a module's specific lessons in their stored order.
In this lesson, we'll implement most of the CRUD functionality for our lessons, including creating, updating, deleting, and patching our lesson's tags. We'll also discuss why we'll treat lessons as a top-level resource.
I Ran into a ReferenceError and realized our ESLint wasn't working. In this lesson, we'll take a brief aside to fix the linting within our project so it works with ESLint v9
In this lesson, we'll remove our GET module route, using the except method on our resource. Then we'll refactor to add a GetModules action
In this lesson, we'll work on nested resourceful endpoints for our course modules. We'll add endpoints to create, update, patch, and deleting modules from a specific course.
In this lesson, we'll add a specific endpoint with the ability to patch a course's difficulty, status, or access level with a new value so our users have a way to update these without needing to send the entire course payload.
In this lesson, we wrap up the Courses controller by adding a show method that fetches all the key info for a single course. That includes its modules and lessons, all nicely organized and ready to use in your API response.
In this lesson, we'll transform our courses list endpoint into a pagination endpoint. We'll check and validate our query string for a page and per page parameter that we'll then use to fetch pages of our courses.
In this lesson, we'll add endpoints to allow creating, updating, and deleting courses from our API. We'll then use this to stub a number of test courses to give us wiggle room to play with our pagination.
Our goal in this step is to add an endpoint that lists our courses. We'll then build upon this endpoint further with the ultimate goal of getting a list of paginated courses.
In this lesson, we'll implement our API Authorization checks across all the API controller methods we've implemented thus far. We'll then create a specific access token for each operation (read, create, update, and delete) to ensure everything is working.
In this lesson, we'll duplicate everything we did one more time for our organization's statuses.
In this lesson, we'll walk through adding API endpoints for the full CRUD (create, read, update, and delete) flow for our organization's access levels.
Showing 1 to 20 of 389 results