Fireship · @fireship

Laravel in 100 Seconds

Uploaded September 23, 2022 · Length 2:22

Laravel in 100 Seconds

Summary

laravel web framework basics in 100 seconds, including model view controller, eloquent orm, and blade templates.

  • laravel
  • mvc
  • eloquent
  • blade
  • php
  • web development

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:00

    laravel a full stack PHP based web

  3. 0:03

    framework famous for its carefully

  4. 0:04

    crafted and much-loved developer

  5. 0:06

    experience it was created in 2011 by

  6. 0:08

    Taylor otwell who was inspired by prior

  7. 0:10

    work like codeigniter or Symphony and

  8. 0:12

    rails it has a large following of

  9. 0:14

    independent developers thanks to its

  10. 0:16

    laser focus on clean and minimal code

  11. 0:18

    along with a huge ecosystem of tools

  12. 0:20

    that can do the heavy lifting

  13. 0:21

    traditionally it's used as a model view

  14. 0:23

    controller framework to build

  15. 0:24

    server-side web applications a model

  16. 0:26

    represents data that can live in a wide

  17. 0:28

    variety of databases while a view

  18. 0:30

    represents what the end user sees in

  19. 0:31

    HTML the user powered by blade templates

  20. 0:34

    that can buy a PHP and HTML code into a

  21. 0:37

    single file and finally we have a router

  22. 0:39

    and controllers in the middle which

  23. 0:40

    allow the user to safely interact with

  24. 0:42

    the data model this pattern can be used

  25. 0:44

    to build monolithic applications but

  26. 0:46

    laravel can also build Standalone apis

  27. 0:48

    or integrate with popular front-end

  28. 0:50

    Frameworks thanks to an adjacent Library

  29. 0:52

    called inertia most importantly though

  30. 0:53

    its ecosystem has out-of-the-box

  31. 0:55

    solutions for features like user

  32. 0:57

    authentication payments full text search

  33. 0:59

    and many other others to get started

  34. 1:01

    install PHP and composer then create a

  35. 1:03

    new project by default it will be

  36. 1:05

    configured with mySQL as the database

  37. 1:07

    the application lifecycle starts in the

  38. 1:09

    index PHP file when a user makes a

  39. 1:11

    request it goes to the HTTP kernel which

  40. 1:14

    contains middleware to intercept the

  41. 1:15

    request and register service providers

  42. 1:17

    like a router which itself determines

  43. 1:19

    that controller action to trigger based

  44. 1:21

    on the URL the user navigated to now a

  45. 1:24

    controller is just a PHP class that

  46. 1:26

    contains a variety of methods like show

  47. 1:28

    update edit and destroy it follows a

  48. 1:30

    convention where show represents a git

  49. 1:32

    request for an individual entity while

  50. 1:35

    store represents a post request to

  51. 1:37

    create a new entity inside a method we

  52. 1:39

    might use a model to make a query to the

  53. 1:41

    database but instead of raw SQL code it

  54. 1:43

    uses eloquent orm making the code far

  55. 1:46

    more human readable every database table

  56. 1:48

    has a corresponding model class which

  57. 1:50

    can be customized as needed now back in

  58. 1:52

    the controller the return value from a

  59. 1:54

    method is a view the view is a blade

  60. 1:56

    template that interpolates the data from

  61. 1:58

    the database directly into HTML ml it