Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Jul 13, 2019
1 parent efe208a commit 4983f6f
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 1 deletion.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# EloquentPlus
Laravel elequent for javascript/nodejs :)

## help

```
node artisan help
node artisan list
node artisan --help
node artisan --h
```

## Create a model


```
node artisan make:model
```

## Create a migration

```
node artisan make:migrate
```


## Create a controller

```
node artisan make:controller
```






8 changes: 8 additions & 0 deletions app/Http/Comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// 4xmen under GPL-3 License
// import modules

class Comment extends Controller {

}

8 changes: 8 additions & 0 deletions app/back.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// 4xmen under GPL-3 License
// import modules

class back extends Model {

}

14 changes: 14 additions & 0 deletions artisan.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ switch (cmdln[0]) {
console.log('The controller name is empty : | ');
}
break;
case 'make:controller':
if (cmdln[1] != undefined) {
require('./arts/controller').make(cmdln[1]);
} else {
console.log('The controller name is empty : | ');
}
break;
case 'make:migrate':
if (cmdln[1] != undefined) {
require('./arts/migrate').make(cmdln[1]);
} else {
console.log('The controller name is empty : | ');
}
break;

default:
console.log('undefined command : ( ');
Expand Down
33 changes: 33 additions & 0 deletions arts/migrate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
var fs = require("fs");
var plur = require('pluralize')
exports.make = (name) => {
var path = './database/migrations/' + name + '.js';
if (fs.existsSync(path)) {
console.log('Error: Unable to create migration')
console.log(`The migration "${name}" is exists : (`);
return;
}
var pl = plur.plural(name);
fs.writeFile(path, `
// 4xmen under GPL-3 License
// import modules
class Create${pl}Table extends Migration {
up (){
Schema.create = function(table){
table.bigIncrements('id');
table.timestamps();
}
}
down(){
Schema.drop('${pl}');
}
}
`, (e) => {
if (e == null)
console.log(`${name} migration class created successfully : ) `);
});

};
14 changes: 14 additions & 0 deletions database/migrations/Person.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

// 4xmen under GPL-3 License
// import modules

class CreatePeopleTable extends Migration {
up (){

}

down(){
Schema::drop('flights');
}
}

18 changes: 18 additions & 0 deletions database/migrations/back.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

// 4xmen under GPL-3 License
// import modules

class CreatebacksTable extends Migration {

up (){
Schema.create = function(table){
table.bigIncrements('id');
table.timestamps();
}
}

down(){
Schema.drop('backs');
}
}

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"dotenv": "^8.0.0",
"fs": "^0.0.1-security",
"mysql": "^2.17.1"
"mysql": "^2.17.1",
"pluralize": "^8.0.0"
}
}

0 comments on commit 4983f6f

Please sign in to comment.