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をPHP8で動かしてみた
Search
qst_exe
January 22, 2021
Programming
0
170
LaravelをPHP8で動かしてみた
「Webナイト宮崎 Vol.12 ~てげPHP学びたい~」でLTした内容です
https://tegehoge.connpass.com/event/199828/
qst_exe
January 22, 2021
Tweet
Share
More Decks by qst_exe
See All by qst_exe
Apple Vision Pro であそぼ in さくらじまハウス
qst_exe
0
20
Google I/O 2024 Firebase のアップデート内容
qst_exe
0
140
Babylon.js で始めるヘッドレス CMS/A headless CMS on Babylon.js
qst_exe
0
190
WebXR で Web をもっと楽しもう
qst_exe
0
240
今年のメタバースについての取り組みとこれから
qst_exe
0
230
今年のメタバースについての取り組みとこれから
qst_exe
0
63
visionOSアプリ開発について
qst_exe
0
140
visionOSアプリ開発のすゝめ
qst_exe
0
140
EDDのすゝめ 〜LT大会に参加しませんか?〜
qst_exe
0
54
Other Decks in Programming
See All in Programming
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
Symfony Mapper Component
soyuka
2
730
Full stack testing :: basic to basic
up1
1
930
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
From Translations to Multi Dimension Entities
alexanderschranz
2
130
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
770
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
960
useSyncExternalStoreを使いまくる
ssssota
6
1k
Criando Commits Incríveis no Git
marcelgsantos
2
170
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
A Modern Web Designer's Workflow
chriscoyier
693
190k
A Philosophy of Restraint
colly
203
16k
How GitHub (no longer) Works
holman
311
140k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
How STYLIGHT went responsive
nonsquared
95
5.2k
GitHub's CSS Performance
jonrohan
1030
460k
The Pragmatic Product Professional
lauravandoore
32
6.3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Transcript
LaravelΛPHP8Ͱಈ͔ͯ͠Έͨ WebφΠτٶ࡚ Vol. 12 2021-01-22 ͨ͘͢Μ
Agenda 1. ࣗݾհ 2. PHP8ͷ֓ཁհ 3. Laravelͷಋೖ
ࣗݾհ ◆໊લɿͨ͘͢Μ ◆ग़ɿࣛࣇౡݝͷେ۱ (ٶ࡚دΓͷχϯήϯͰ͢ʂ) ◆ࣗݾհ ιϑτΣΞΤϯδχΞ(εϚϗΞϓϦ։ൃ, WebγεςϜ։ൃ) ઐֶߍͷඇৗۈߨࢣ(PHPڭ͑ͯ·͢) ࣛࣇౡ.mk, ώϥϚαͳͲͷίϛϡχςΟ׆ಈ
SNSͬͯ·͢ʔ
ྗΛೖΕ͍ͯΔίϛϡχςΟ׆ಈ ࣛࣇౡ.mk ώϥϚα ॳݟͷਓͰؾܰʹࢀՃͰ͖ΔίϛϡχςΟ ڞಉ։ൃͱ͔৭ʑͬͯΔΤϯδχΞαʔΫϧ
PHP8ʹ͍ͭͯ
ओཁػೳ • JITͷಋೖ • Named Arguments • Attributes • Constructor
Property Promotion • Union Types • Match Expressions • Nullsafe Operator • ൺֱԋࢉࢠ(==)ͷڍಈݟ͠
PHP7͔ΒPHP8ͷॻ͖͑ • ൺֱԋࢉࢠ(==)Λ͍ͬͯͳ͚Εॻ͖͑ͦ͢͠͏ • PHP5͔ΒPHP7ͷॻ͖͑େมͩͬͨهԱ(ඇਪͳॻ͖ํ͕ଟ ͔͍͔ͬͨͤ) • Laravelͷ߹ɺ6~8ܥͷ߹ʹPHP8ʹରԠ͍ͯ͠Δͱͷ͜ͱ • https://blog.laravel.com/laravel-php-8-support
Laravelͷಋೖ
લఏ • ϩʔΧϧڥ(macOS)ͱQAڥ(Heroku)Ͱݕূ • όʔδϣϯཧʹphpbrewΛར༻ • ରͷΞϓϦतۀ༻ʹ࡞ͬͨ࠷ݶͷCRUDΞϓϦ • Laravelͷόʔδϣϯ7.xܥ •
ݫ֨ϞʔυͰܕݫີʹཧ
None
PHP8ͷΠϯετʔϧ&༗ޮԽ $ php -v PHP 7.3.11 (cli) (built: Jun 5
2020 23:50:40) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies $ phpbrew self-update $ phpbrew known --update $ phpbrew install 8.0.1 +default +dbs +curl $ phpbrew use php-8.0.1 $ php -v PHP 8.0.1 (cli) (built: Jan 22 2021 01:59:33) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.1, Copyright (c) Zend Technologies
ϩʔΧϧαʔόͷىಈ $ php artisan serve Laravel development server started: http://127.0.0.1:8000
PHP 8.0.1 Development Server (http://127.0.0.1:8000) started ىಈͨ͠ʂʂ
HerokuͷσϓϩΠ "php": "^8.0.0" "fakerphp/faker": "^1.9.1" "phpunit/phpunit": "^9.3" $ composer update
composer.jsonͷPHPόʔδϣϯΛߋ৽
HerokuͷσϓϩΠ -----> Building on the Heroku-20 stack -----> PHP app
detected -----> Bootstrapping... -----> Installing platform packages... - php (8.0.1) - ext-mbstring (bundled with php) - apache (2.4.46) - nginx (1.18.0) - composer (1.10.19) (தུ) -----> Launching... Released v19 https://laravel-todo-php8.herokuapp.com/ deployed to Heroku PHP8ͰͷHerokuͷσϓϩΠޭʂʂ
݁ LaravelΛPHP8Ͱಈ͔͢ͷಛʹͳ͠
ࠓޙͷ՝ • ։ൃɾQAڥͰ͔͠ར༻Ͱ͖͍ͯͳ͍ͷͰɺϓϩμΫγϣϯڥͰ ͑ΔΑ͏ʹݕূΛ͢Δ • PHP8ʹͳͬͯύϑΥʔϚϯε͕ͲΕ͘Β͍վળͨ͠ͷ͔ͷௐࠪ • Laravel 5.xܥͰPHP8Λ͑ΔΑ͏ʹ͢ΔͨΊͷௐࠪ
དྷिʹ͘͘ձɺདྷ݄ʹϋοΧιϯΓ·͢ ڵຯͷ͋Δํʮࣛࣇౡ.mkʯͰݕࡧΛʂ
Thank You!!