Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Laravelで自家製ライブラリを作ってみよう!
Search
syossan27
June 20, 2022
Programming
550
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravelで自家製ライブラリを作ってみよう!
syossan27
June 20, 2022
More Decks by syossan27
See All by syossan27
数値変えただけで年間約100万円コスト削減した話
syossan27
2
930
一人でちいさくはじめる Platform Engineering
syossan27
4
3.2k
一人SREが歩んだPlatform Engineeringスモールスタート実践録 ~ クラウドネイティブ会議版 ~
syossan27
4
2.4k
プロポーザル サポートガイドを読み解いていこう!
syossan27
3
1.1k
幻滅期を越える サイトリライアビリティ エンジニアリング
syossan27
1
280
一人SREが歩んだ Platform Engineering スモールスタート実践録
syossan27
2
2.1k
SREって何? 現場で学んだサイト信頼性の第一歩
syossan27
5
1.7k
知識0からカンファレンスやってみたらこうなった!
syossan27
5
810
突然のメモリ使用率上昇へ対応! k8sカスタムコントローラー開発事例
syossan27
2
600
Other Decks in Programming
See All in Programming
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
Performance Optimization With LLMs
xleitix
0
150
Domain-Driven Transformation
hschwentner
2
2.3k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
contenteditable と日本語入力に向き合う
colorful12
0
200
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.2k
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
990
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
0
110
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
450
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
480
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
The Cost Of JavaScript in 2023
addyosmani
55
10k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Paper Plane
katiecoart
PRO
5
54k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
It's Worth the Effort
3n
188
29k
ラッコキーワード サービス紹介資料
rakko
1
5.4M
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
570
Transcript
Laravelで 自家製ライブラリを 作ってみよう!
自己紹介 名前:井上翔太(しょっさん:syossan27) 所属:株式会社コンテンツワン スキル:PHPer歴2年ちょいのひよっこPHPer 性格:適当・ずぼら
LTやる前に一つ
物凄く慌てて資料作りました
None
間違いがあれば ご指摘オナシャス!
今回は
ライブラリ作っていきます
None
まずはライブラリ入れとく ディレクトリ作り
None
mkdir libraries
プロジェクトのappの下に作ると 良いかも
次に
作ったディレクトリを 設定ファイルに記述します
None
app/start/global.php ClassLoader::addDirectories(array( app_path().'/commands', app_path().'/controllers', app_path().'/models', app_path().'/database/seeds', app_path().'/libraries' ←追加! ));
composer.json "autoload": { "classmap": [ "app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds",
"app/tests/TestCase.php", "app/libraries" ←追加! ] }
設定後は composer dump-autoload を忘れずに!
そろそろライブラリファイルを 作成していきます
None
今回は libraries/helper.php として作成します
helper.php <?php class Helper { public static function test(){ print_r(“テストだよ!”);
} }
タレ完成!
それじゃタレ使って 料理してみましょう!
None
間違えました(・ω<)
MainController index(){ Helper::test(); }
indexにアクセスしてみると・・・
None
動いた!
皆さんも是非自家製ライブラリ 作ってみてください!
None