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
21
Google I/O 2024 Firebase のアップデート内容
qst_exe
0
160
Babylon.js で始めるヘッドレス CMS/A headless CMS on Babylon.js
qst_exe
0
210
WebXR で Web をもっと楽しもう
qst_exe
0
260
今年のメタバースについての取り組みとこれから
qst_exe
0
250
今年のメタバースについての取り組みとこれから
qst_exe
0
67
visionOSアプリ開発について
qst_exe
0
150
visionOSアプリ開発のすゝめ
qst_exe
0
150
EDDのすゝめ 〜LT大会に参加しませんか?〜
qst_exe
0
58
Other Decks in Programming
See All in Programming
自動で //nolint を挿入する取り組み / Gopher's Gathering
utgwkk
1
150
CNCF Project の作者が考えている OSS の運営
utam0k
5
550
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
590
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
3k
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
18
3k
Linux && Docker 研修/Linux && Docker training
forrep
16
3k
DMMオンラインサロンアプリのSwift化
hayatan
0
230
Azure AI Foundryのご紹介
qt_luigi
1
240
最近のVS Codeで気になるニュース 2025/01
74th
1
220
Amazon Bedrock Multi Agentsを試してきた
tm2
1
180
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
270
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
74
9.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
The Cult of Friendly URLs
andyhume
78
6.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Being A Developer After 40
akosma
89
590k
A Philosophy of Restraint
colly
203
16k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
11
890
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
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!!