2.1.69 • Published 4 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
4 years ago
2.1.67
4 years ago
2.1.68
4 years ago
2.1.65
4 years ago
2.1.66
4 years ago
2.1.64
4 years ago
2.1.61
4 years ago
2.1.60
4 years ago
2.1.58
4 years ago
2.1.56
5 years ago
2.1.57
5 years ago
2.1.55
5 years ago
2.1.54
5 years ago
2.1.53
5 years ago
2.1.52
5 years ago
2.1.51
5 years ago
2.1.50
5 years ago
2.1.49
5 years ago
2.1.48
5 years ago
2.1.46
5 years ago
2.1.45
5 years ago
2.1.44
5 years ago
2.1.43
5 years ago
2.1.42-1
5 years ago
2.1.42-0
5 years ago
2.1.41
5 years ago
2.1.40
5 years ago
2.1.38
5 years ago
2.1.39
5 years ago
2.1.37
5 years ago
2.1.36
5 years ago
2.1.35
5 years ago
2.1.34
5 years ago
2.1.33
5 years ago
2.1.32
5 years ago
2.1.31
5 years ago
2.1.30
5 years ago
2.1.29
5 years ago
2.1.27
5 years ago
2.1.28
5 years ago
2.1.26
5 years ago
2.1.24
5 years ago
2.1.23
5 years ago
2.1.21
5 years ago
2.1.22
5 years ago
2.1.20
5 years ago
2.1.19
5 years ago
2.1.18
5 years ago
2.1.17-canary-01
5 years ago
2.1.17-canary
5 years ago
2.0.17-dev
5 years ago
2.0.17
5 years ago