2.1.69 • Published 2 years ago
@ordentco/ramenbox v2.1.69
/# Adonis Ramenbox
Installation
Adonis Ramenbox requires Adonisjs v4 to run.
Install the PeerDependencies in your host application
"@adonisjs/bodyparser": "^2.0.5",
"@adonisjs/cors": "^1.0.7",
"@adonisjs/drive": "^1.0.4",
"@adonisjs/fold": "^4.0.9",
"@adonisjs/generic-exceptions": "^3.0.1",
"@adonisjs/validator": "^5.0.6",
"adonis-bumblebee": "^2.1.0",
"adonis-lucid-filter": "^1.0.5",
"@ordentco/adonis-drive": "^1.0.2",
"@slynova/flydrive": "^1.0.3",
"@slynova/flydrive-gcs": "^1.0.3"
set your config/drive.js
'use strict'
const Helpers = use('Helpers')
const Env = use('Env')
module.exports = {
/*
|--------------------------------------------------------------------------
| Default disk
|--------------------------------------------------------------------------
|
| The default disk is used when you interact with the file system without
| defining a disk name
|
*/
default: 'local',
disks: {
/*
|--------------------------------------------------------------------------
| Local
|--------------------------------------------------------------------------
|
| Local disk interacts with the a local folder inside your application
|
*/
local: {
driver: 'local',
config: {
root: Helpers.tmpPath()
}
},
/*
|--------------------------------------------------------------------------
| S3
|--------------------------------------------------------------------------
|
| S3 disk interacts with a bucket on aws s3
|
*/
s3: {
driver: 's3',
config: {
key: Env.get('S3_KEY'),
secret: Env.get('S3_SECRET'),
bucket: Env.get('S3_BUCKET'),
region: Env.get('S3_REGION')
}
},
gcs: {
driver: 'gcs',
config: {
keyFilename: Env.get('GCS_KEY_FILE_NAME'), // path to json file
bucket: Env.get('GCS_BUCKET')
}
}
}
}
add provider to start/app.js
const providers = [
...
'@adonisjs/validator/providers/ValidatorProvider',
'@ordentco/adonis-drive/providers/DriveProvider',
'adonis-bumblebee/providers/BumblebeeProvider',
'adonis-lucid-filter/providers/LucidFilterProvider',
...
]
Controller
const RamenController = require('../../../packages/ramenbox/src/Controller/RamenController')
Model
const RamenController = require('../../../packages/ramenbox/src/Controller/RamenController')
Properties
static get properties () {
return ['id', 'username', 'password', 'email', 'created_at', 'updated_at', 'image']
}
Slug
static get slug(){
return 'email'
}
Rules
static get rules(){
return {
post: {
email: 'required|email|unique:users,email',
username: 'required'
}
}
}
Relations
static get relations(){
return ['profiles', 'tokens']
}
Sanitize
static get sanitize(){
return {
post: {
'email': 'normalize_email'
}
}
}
Transformer
const RamenTransformer = require('../../../packages/ramenbox/src/Controller/RamenController')
2.1.69
2 years ago
2.1.67
2 years ago
2.1.68
2 years ago
2.1.65
2 years ago
2.1.66
2 years ago
2.1.64
3 years ago
2.1.61
3 years ago
2.1.60
3 years ago
2.1.58
3 years ago
2.1.56
3 years ago
2.1.57
3 years ago
2.1.55
4 years ago
2.1.54
4 years ago
2.1.53
4 years ago
2.1.52
4 years ago
2.1.51
4 years ago
2.1.50
4 years ago
2.1.49
4 years ago
2.1.48
4 years ago
2.1.46
4 years ago
2.1.45
4 years ago
2.1.44
4 years ago
2.1.43
4 years ago
2.1.42-1
4 years ago
2.1.42-0
4 years ago
2.1.41
4 years ago
2.1.40
4 years ago
2.1.38
4 years ago
2.1.39
4 years ago
2.1.37
4 years ago
2.1.36
4 years ago
2.1.35
4 years ago
2.1.34
4 years ago
2.1.33
4 years ago
2.1.32
4 years ago
2.1.31
4 years ago
2.1.30
4 years ago
2.1.29
4 years ago
2.1.27
4 years ago
2.1.28
4 years ago
2.1.26
4 years ago
2.1.24
4 years ago
2.1.23
4 years ago
2.1.21
4 years ago
2.1.22
4 years ago
2.1.20
4 years ago
2.1.19
4 years ago
2.1.18
4 years ago
2.1.17-canary-01
4 years ago
2.1.17-canary
4 years ago
2.0.17-dev
4 years ago
2.0.17
4 years ago