This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RegisterController.php | |
$ vim app/Http/Controllers/Auth/RegisterController.php | |
$ cat app/Http/Controllers/Auth/RegisterController.php | |
<?php | |
namespace App\Http\Controllers\Auth; | |
# 「Models\」を追加 | |
use App\Models\User; | |
use App\Http\Controllers\Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mv app/User.php app/Models/ | |
$ vim app/Models/User.php | |
$ cat app/Models/User.php | |
<?php | |
# 「Models\」を追加 | |
namespace Models\App; | |
use Illuminate\Notifications\Notifiable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd <Laravelプロジェクト PATH> | |
$ mkdir app/Models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let insert = await this.client.query( | |
'INSERT INTO table(column1, column2, column3, column4, column5) VALUES($1, $2, $3, $4, $5)', | |
[val1, val2, val3, val4, val5] | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let insert = await this.client.query( | |
'INSERT INTO table(column1, column2, column3, column4, column5) VALUES($1, $2, $3, $4, $5)', | |
[val1, val2, val3, val4] | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat es6.js | |
import moment from 'moment'; | |
console.log(moment.now()); | |
$ npm run start | |
> nodejs@1.0.0 start /Users/daiki.sekiguchi/work/blog/nodejs | |
> babel-node es6.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
"scripts": { | |
"start": "babel-node es6.js", | |
... | |
}, | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
[ | |
"env", { | |
"targets": { | |
"node": "current" | |
} | |
} | |
] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm install --save-dev babel-cli | |
$ npm install --save-dev babel-preset-env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat es6.js | |
import moment from 'moment'; | |
console.log(moment.now()); | |
$ node es6.js | |
/Users/daiki.sekiguchi/work/blog/nodejs/es6.js:1 | |
(function (exports, require, module, __filename, __dirname) { import moment from 'moment'; | |
^^^^^^ |
NewerOlder