Prerequisite Videos
Watch both short videos before starting the lab. They introduce the framework and container environment you will investigate.
Laravel
Docker
Watch Laravel in 100 Seconds, then keep the Laravel documentation available as a reference.
Video Transcript
Intro
0:00
[Music]
0:00
laravel a full stack PHP based web
0:03
framework famous for its carefully
0:04
crafted and much-loved developer
0:06
experience it was created in 2011 by
0:08
Taylor otwell who was inspired by prior
0:10
work like codeigniter or Symphony and
Overview
0:12
rails it has a large following of
0:14
independent developers thanks to its
0:16
laser focus on clean and minimal code
0:18
along with a huge ecosystem of tools
0:20
that can do the heavy lifting
0:21
traditionally it's used as a model view
0:23
controller framework to build
0:24
server-side web applications a model
0:26
represents data that can live in a wide
0:28
variety of databases while a view
0:30
represents what the end user sees in
0:31
HTML the user powered by blade templates
0:34
that can buy a PHP and HTML code into a
0:37
single file and finally we have a router
0:39
and controllers in the middle which
0:40
allow the user to safely interact with
0:42
the data model this pattern can be used
0:44
to build monolithic applications but
Code
0:46
laravel can also build Standalone apis
0:48
or integrate with popular front-end
0:50
Frameworks thanks to an adjacent Library
0:52
called inertia most importantly though
0:53
its ecosystem has out-of-the-box
0:55
solutions for features like user
0:57
authentication payments full text search
0:59
and many other others to get started
1:01
install PHP and composer then create a
1:03
new project by default it will be
1:05
configured with mySQL as the database
1:07
the application lifecycle starts in the
1:09
index PHP file when a user makes a
1:11
request it goes to the HTTP kernel which
1:14
contains middleware to intercept the
1:15
request and register service providers
1:17
like a router which itself determines
1:19
that controller action to trigger based
1:21
on the URL the user navigated to now a
1:24
controller is just a PHP class that
1:26
contains a variety of methods like show
1:28
update edit and destroy it follows a
1:30
convention where show represents a git
1:32
request for an individual entity while
1:35
store represents a post request to
1:37
create a new entity inside a method we
1:39
might use a model to make a query to the
1:41
database but instead of raw SQL code it
1:43
uses eloquent orm making the code far
1:46
more human readable every database table
1:48
has a corresponding model class which
1:50
can be customized as needed now back in
1:52
the controller the return value from a
1:54
method is a view the view is a blade
1:56
template that interpolates the data from
1:58
the database directly into HTML ml it
2:00
has the full power of PHP allowing you
2:02
to implement conditional logic and loops
2:04
with a familiar syntax but laravel comes
2:07
with a ton of other built-in features
2:08
like cues file storage websockets for
2:11
real-time apps just to name a few this
2:13
has been laravel in 100 seconds hit the
2:15
like button if you want to see more
2:16
short videos like this thanks for
2:18
watching and I will see you in the next
2:19
one
Watch Docker in 100 Seconds, then review Docker's Get Started guide.
Video Transcript
0:00 docker a tool that can package software
0:02 into containers that run reliably in any
0:04 environment but what is a container and
0:06 why do you need one let's imagine you
0:07 built an app with cobalt that runs on
0:09 some weird flavor of linux you want to
0:11 share this app with your friend but he
0:12 has an entirely different system so the
0:14 problem becomes how do we replicate the
0:15 environment our software needs on any
0:17 machine one way to package an app is
0:19 with a virtual machine where the
0:20 hardware is simulated then installed
0:22 with the required os and dependencies
0:24 this allows us to run multiple apps on
0:25 the same infrastructure however because
0:27 each vm
0:28 is running its own operating system they
0:30 tend to be bulky and slow
0:32 now a docker container is conceptually
0:34 very similar to a vm
0:35 with one key difference instead of
0:36 virtualizing hardware containers only
0:38 virtualize the os
0:40 or in other words all apps or containers
0:42 are run by a single kernel
0:44 and this makes almost everything faster
0:45 and more efficient there are three
0:47 fundamental elements in the universe of
0:49 docker
0:49 the docker file the image and the
0:51 container the docker file is like dna
0:54 it's just code that tells docker how to
0:56 build an image which itself is a
0:58 snapshot of your software
1:00 along with all of its dependencies down
1:01 to the operating system level the image
1:03 is immutable and it can be used to spin
1:05 up multiple containers which is your
1:07 actual software running in the real
1:08 world
1:09 create a docker file and use from to
1:11 start from an existing template like
1:13 ubuntu this base image gets pulled down
1:15 from the cloud
1:15 and you can also upload your own images
1:17 to a variety of different docker
1:19 registries
1:19 from there you might want to use run to
1:21 run a terminal command that installs
1:23 dependencies into your image
1:24 you can set environment variables and do
1:26 all kinds of other stuff then the last
1:27 thing you'll do is set a default command
1:29 that's executed when you start up a
1:30 container
1:31 and now we can create the image file by
1:33 running the docker build command
1:34 it goes through each step in our docker
1:36 file to build the image layer by layer
1:38 we can then bring this image to life as
1:40 a container with the docker run command
1:42 as your app demands more resources you
1:44 can run it on multiple machines multiple
1:46 clouds on-prem
1:47 or wherever you want reliably this has
1:49 been docker in 100 seconds
1:51 if you enjoyed it make sure to like and
1:52 subscribe and stay tuned for more docker
1:54 content coming to this channel soon
1:56 thanks for watching and i will see you
1:58 in the next one
Continue to Explore the Apple Store.