AdonisJS - Event

Modern application development requires that some actions are carried out when a point of the application is reached. Tasks like confirmation email, invoice generation, logging and profiling are few of things that requires to be carried out in specific regions of application flow. These actions that are triggered are called Events. Events in modern application development make code execution after a web request to the server has been completed to be possible....

January 19, 2020 · 2 min · Aleem Isiaka

AdonisJS - Route Model Binding

AdonisJS was built for the NodeJS Artisans taking after the concepts of Laravel - The PHP framework for Artisans. AdonisJS did a great job porting these concepts into JavaScript, it maintains the namespace even though JavaScript does not support that, it using its own fast, easy and extendable view engine and many more, but some features of Laravel are not shipped with AdonisJS by default. The IoC container in Laravel auto injects classes by inspection when a recognized namespace is Type Hinted....

January 12, 2020 · 4 min · Aleem Isiaka

AdonisJS - Using Validators with resource routes

First, install the Validator using the adonis command: adonis install @adonisjs/validtor Create a resource route adonis make:controller PostController --resource Define the route in start/route.js //.. Route.resource("posts", "PostController") //.. Now, we can make a Validator for /posts/store adonis make:validator StorePost This will create a validator in /app/Validators. Finally, To define a validator for a specific route in the definition, do something like this: //.. Route.resource("posts", "PostController").validator([[["store", "StoreUser"]]]) //.. PSSS: I want this as short as it can while still answering question regarding the final code....

January 10, 2020 · 1 min · Aleem Isiaka