
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
adonis-lucid-morphable
Advanced tools
Polymorphic Relations support for Adonis Lucid ^4.1.0.
$ npm i adonis-lucid-polymorphic --save
or
$ yarn add adonis-lucid-polymorphic
const providers = [
...
'adonis-lucid-polymorphic/providers/PolymorphicProvider',
...
]
posts
id - integer
title - string
body - text
videos
id - integer
title - string
url - string
comments
id - integer
body - text
commentable_id - integer
commentable_type - string
// App/Model/Post
'use strict'
const Model = use('Lucid')
class Post extends Model {
static get traits () {
return ['@provider:Morphable']
}
comments () {
return this.morphMany('App/Models/Comment', 'id', 'commentable_id', 'commentable_type')
}
}
module.exports = Post
// App/Model/Video
'use strict'
const Model = use('Lucid')
class Video extends Model {
static get traits () {
return ['@provider:Morphable']
}
comments () {
return this.morphMany('App/Models/Comment', 'id', 'commentable_id', 'commentable_type')
}
}
module.exports = Video
// App/Model/Comment
'use strict'
const Model = use('Lucid')
class Comment extends Model {
static get traits () {
return ['@provider:Morphable']
}
commentable () {
return this.morphTo([
'App/Models/Post', 'App/Models/Video'
], 'id', 'id', 'commentable_id', 'commentable_type')
}
}
module.exports = Video
...
class Comment extends Model {
static get traits () {
return ['@provider:Morphable']
}
commentable () {
return this.morphTo([
'App/Models/Post', 'App/Models/Video'
], 'id', 'id', 'commentable_id', 'commentable_type')
}
}
...
...
class Post extends Model {
static get traits () {
return ['@provider:Morphable']
}
comments () {
return this.morphMany('App/Models/Comment', 'id', 'commentable_id', 'commentable_type')
}
}
...
...
class Publication extends Model {
static get traits () {
return ['@provider:Morphable']
}
content () {
return this.morphOne('App/Models/Content', 'id', 'contentable_id', 'contentable_type')
}
}
...
Having trouble? Open an issue!
The MIT License (MIT). Please see License File for more information.
FAQs
Adonis Lucid ^4.1.0 Polymorphic Relations Support.
The npm package adonis-lucid-morphable receives a total of 0 weekly downloads. As such, adonis-lucid-morphable popularity was classified as not popular.
We found that adonis-lucid-morphable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.