Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Laravelの歩き方 〜Webアーキテクチャを学ぶ〜

Laravelの歩き方 〜Webアーキテクチャを学ぶ〜

Laravelの基礎を知っている方向けに、Webアーキテクチャの視点からLaravel解説します。

More Decks by 株式会社エッグシステム

Other Decks in Programming

Transcript

  1. Laravel Web    

  2. 8,6$ • -13* • 2.'5/+ • 70   

     • )(4 &"%#  ◦   ▪ GCP / AWS ▪ laravel / rails / .net ▪ nuxt ◦ IT   ▪ ERP ◦ HP ! ▪ wordpress
  3. 

  4. '-%,: • Laravel*6 &710 • #Laravel /)  • Laravel20

    '-%(.  • Web "!3 • MVC$+Web 98045 
  5. &)%(  • Laravel ,* • Laravel -  •

    !$ Web$! $# • Laravel $"$# '+
  6.   /  1 • ")  ◦ *,!

      ◦ %&#+.- ◦ '($0
  7. $ +' • Laravel MVC (%) ! • DI "

    ) #  • readable 1/10 ,&  • Laravel  *. - 
  8. "!  1. Laravel$ ◦     

     2. Laravel  ◦ 1 Laravel 3. Laravel # ◦ MVC ◦ MVVM ◦ Flux
  9. Laravel

  10. Laravelconfig[email protected]FW • Laravel config[email protected]=;? ◦ config*0%6*0config ◦ !-2' :config9 4

    E8 ▪ php artisan config:cache ◦ Laravel config*06 envBD ▪ config = envAC  • configB7"3)#,1(% ◦ configenv< #$+'/( .& 5> 
  11. • config. !5_ZMBODIQW  • DI]G. !5HY#3&T]\NU • Laravel DIAIR'!/,7*08&

    ◦ %8-&/6+!(D Hb!7&'7&TG  ◦ IR!7'8."8& PG  • DI^@;:924)* ◦ `RIRES C? =EKZ ▪ D=IR[  ◦ aJX/6$317$KZ ▪ #3&!7'8."8&HY  Dependency Injection(<FLV>)
  12. DI -*8 1: (Route.php +) • (')# (# )(. ◦

    readable • ,0<75 )(.  ◦ [email protected] • $ &"( (# #!)96 ◦ [email protected] • #!) )(% • ; (# 24 / (3=
  13. )& ("$ • ("$'  ◦ Container.php • =A("$' -

    6B 0I.*F ◦ 3<@' 2( !( H:I. ◦ ("$' ' 28;( !( G • ("$composite%!)( 7C  ◦ ("$/("$,5E> 41  ◦ ( #'!8; • DI+)& ("$ 0' ?J 9D
  14. • .%- "DK *  • +!$.49I ◦ @GIlluminate¥Http¥Request$.4 

    ◦ php?A$_get 0B6H • config1'..%- "DK ◦ DI0 8>E2.%*DK ; • Application.php3 9I ◦ Application.php- "  ◦ composite$.- 9J • FacadeDK9< ◦ Facade(+!*7FC)/:=5 .%&,#  
  15. Tips: "5,$0$ • .#(?;'5%8JI  • "5,$0$9E8JI 0$ • /'20$GetterSetterHA<:;

     ◦ 4%5-5$BF  ◦ "5,$0$4%5-5$=* FD6  • DB$(35#@G1$(+5$'5%7> 9EC • Laravel<:"5,$!4&) 
  16. Laravel

  17. Laravel • !"& '$%( ◦ https://readouble.com/laravel/6.x/ja/lifecycle.html • !"2#)  

    ◦ HTTPConsole ▪ public/index.php ▪ artisan • HTTPConsole 
  18. • Laravel%$+(, public/index.php.- • public/index.php, ◦ public/index.php • Request!, ◦

    [email protected][email protected] • '/Global #(32 ◦ [email protected][email protected] • )"+10 +*,& #(32 ◦ [email protected] • readable  HTTP, ( 
  19. Console*"'  • artinsan/. ◦ php artisan artisan#';<  ◦

    artisann+=34  ◦ artisan • 058SymphonyConsole)%*")$*  • - 297Artisan&) (*  ◦ [email protected] ◦ Artisan&) )!  • )!34&) ,1:6 ◦ [email protected][email protected]
  20. HKernel6G7B • 2? +." -!#:/ • bootstrap/app.php+."-!#[email protected]  ◦ bootstrap/app.php

    ◦ (- .&',%; • 0F 31I.&-!#C>  ◦ HTTP.$+ ◦ Console.$+ ◦ ExceptionHandler • 5<D4.&-!#   ◦ .&',%*.)    EA=
  21. Laravel

  22. MVC (Model, View, Controller) • 3I+$-2*&21 • ModelViewControllerR  •

    5K BN  *&21 • Laravel<9ModelController? • ;FJ/"!%(OQ<9 *&216 ◦ /"!%(C 7H= • LaravelP02(,'0) 1'1#@:  ◦ *.+2&*2%EGDA ◦ Route::bindBN ▪ Eloquent4>BM8L
  23. MVVM (Model, View, ViewModel) • $*++ FW &',  •

    Model,"( 6 • ViewModelView Model> 9 • Graphql. )<?  32 & • Vue js+%,!+ 85 ◦ ViewComposer.1,7/&, ◦ 1+%,!+Blade (#+ • Controller-= ◦ Route::view. ◦ Route::view32php artisan route cache4;0: 
  24. Flux • ,67(7) 0"18  • Facebook LE  '!7+%87

    ◦ Facebook • 4#(MGFC##0  • 7(683 emit/5+8;   • @W28)3* ?RJO  ◦ YDQ?R PH04&( ◦ 9N .6$#TRZ= • -3!> I:XSBA?RJUKV ◦ UX WebSocketX<KV ◦ laravel-echo-server
  25. ) • " '+ •  "!*%   

    • Laravel #&($ 3 "!!  ◦ MVC ◦ MVVM ◦ Flux
  26. DI9B • DI9B • PHP 75 (#*&+/%, • G= 630

    G= 631@A5  <F ◦ +,#, :9B ?24'  • -D>.H4 ';C  ◦ '! ◦ $ ◦ E8#) ",, ◦ +