Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Laravelコマンド作成
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shin.joko
August 28, 2020
Programming
43
0
Share
Laravelコマンド作成
inspireコマンドの日本語Vertを作成してみる
shin.joko
August 28, 2020
More Decks by shin.joko
See All by shin.joko
Laravel blade include・yield・sectionの違い
shinjoko
0
420
Other Decks in Programming
See All in Programming
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
170
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
320
How Swift's Type System Guides AI Agents
koher
0
190
Coding as Prompting Since 2025
ragingwind
0
770
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
ファインチューニングせずメインコンペを解く方法
pokutuna
0
280
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.5k
実践CRDT
tamadeveloper
0
410
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
560
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
110
Rethinking API Platform Filters
vinceamstoutz
0
11k
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.8k
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
6.8k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
150
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
260
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
710
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
410
Mobile First: as difficult as doing things right
swwweet
225
10k
The browser strikes back
jonoalderson
0
940
Transcript
Laravelコマンド作成 php artisan inspireの日本語Verを作ってみる CLOCK・IT,inc All Rights Reserved.
「inspire」コマンドとは コマンドを実行するといくつかの格言からランダムで格言を取得して表示される
実際のロジックを見てみる 見るファイル ・ ~/routes/console.php ・ ~/vender/laravel/src/illuminate/Foundation/Inspiring.php
None
※一部省略してます
日本語の格言が出るものを 作っていく
artisanコマンドの作り方 実現方法として、2パターン存在する ・inspireと同じ作りで、~/routes/console.php に作成する ・~/app/Console 内に作成する
inspireと同じ作りにて作成
inspireと同じ作りにて作成 console.phpにコマンドを追加
適当なディレクトリに格言リストを用意 ※元となるInspiringをextendsしているが、しなくて問題ない ※「static」に注意
実行してみる
/app/Console 内に作成
/app/Console 内に作成 コマンドの作成は「make」コマンドを利用する <書き方> $ php artisan make:command クラス名 ↓
$ php artisan make:command InspiringCommand
~/app/Console/Commands/ InspiringCommand.php
コマンド名を指定 ディスクリプションを記載 実処理を記述
実際に書いていく コマンド名は自由に命名可能 (ディスクルプションも) 実処理に関しては、console.phpで書いたものと同じ
※ useが必要 ※ 実行する内容はconsole.phpと全く同じ
実行してみる
コマンドの作成は完了! $this->comment(); を使っているが、実処理に関してはソースを読んでみてね! ~/vender/laravel/framework/src/illuminate/Console/Concerns/InteractsWithIO.php とか・・・