WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:00.056 --> 00:00:04.606 align:middle
Welcome. Hello.

00:00:04.676 --> 00:00:11.826 align:middle
Hi, my name is Ryan and I have the absolute
pleasure to introduce you to the beautiful

00:00:12.176 --> 00:00:16.376 align:middle
and fascinating and productive
world of Symfony 6.

00:00:16.546 --> 00:00:21.186 align:middle
Seriously, I feel like Willie Wonka
inviting you into my chocolate factory,

00:00:21.546 --> 00:00:25.076 align:middle
except with hopefully less
sugar-related injuries.

00:00:25.596 --> 00:00:28.076 align:middle
Anyways, if you're new to Symfony, I'm...

00:00:28.076 --> 00:00:30.246 align:middle
honestly a bit jealous!

00:00:30.586 --> 00:00:32.496 align:middle
You're going to love the journey...

00:00:33.036 --> 00:00:36.316 align:middle
and hopefully become an even
better developer along the way:

00:00:36.906 --> 00:00:40.106 align:middle
you're definitely going to
build some cool stuff.

00:00:40.166 --> 00:00:45.686 align:middle
The secret sauce of Symfony is that it
starts tiny, which makes it easy to learn.

00:00:46.106 --> 00:00:51.446 align:middle
But then, it scales up its features
automatically through a unique recipe system.

00:00:52.336 --> 00:00:58.726 align:middle
In Symfony 6, those features include new
JavaScript tools and a new security system...

00:00:58.876 --> 00:01:01.836 align:middle
just to name two of the many new things.

00:01:02.346 --> 00:01:09.336 align:middle
Symfony is also lightning fast with a huge
focus on creating a joyful developer experience,

00:01:09.596 --> 00:01:13.736 align:middle
but without sacrificing programming
best practices.

00:01:14.426 --> 00:01:17.956 align:middle
Yea: you get to love coding and love your code.

00:01:18.406 --> 00:01:20.966 align:middle
I know... that sounded cheesy, but it's true.

00:01:21.106 --> 00:01:28.546 align:middle
So come with me and you'll be
in a world of pure elucidation.

00:01:29.306 --> 00:01:32.166 align:middle
That's my first time singing
in these tutorials...

00:01:32.166 --> 00:01:33.346 align:middle
and maybe my last.

00:01:33.656 --> 00:01:34.426 align:middle
Let's get started.

00:01:34.426 --> 00:01:38.536 align:middle
Head over to https://symfony.com/download.

00:01:39.256 --> 00:01:43.266 align:middle
On this page, you'll find some
instructions - which will differ based

00:01:43.266 --> 00:01:48.716 align:middle
on your operating system - on how to
download something called the Symfony binary.

00:01:49.146 --> 00:01:50.296 align:middle
This is...

00:01:50.426 --> 00:01:52.196 align:middle
not actually Symfony.

00:01:52.876 --> 00:01:57.536 align:middle
It's just a command line tool that
will help us start new Symfony projects

00:01:57.826 --> 00:02:00.716 align:middle
and give us some nice local development tools.

00:02:01.206 --> 00:02:03.986 align:middle
It's optional, but I highly recommend it!

00:02:04.546 --> 00:02:10.156 align:middle
Once you've installed this - I already
have - open up your favorite terminal app.

00:02:10.776 --> 00:02:14.366 align:middle
I'm using iTerm for mac, but it doesn't matter.

00:02:14.916 --> 00:02:20.566 align:middle
If you got everything set up correctly, you
should be able to run: symfony Or even better:

00:02:20.566 --> 00:02:27.256 align:middle
symfony list to see a list of all the
"things" that this symfony binary can do.

00:02:28.116 --> 00:02:32.076 align:middle
There's a lot of stuff here: things
that help with "local" development...

00:02:32.336 --> 00:02:35.386 align:middle
and also some optional services for deployment.

00:02:35.646 --> 00:02:38.956 align:middle
We'll walk through the stuff
you need to know along the way.

00:02:39.846 --> 00:02:44.266 align:middle
Ok, so we want to start a
brand new shiny Symfony app.

00:02:44.746 --> 00:02:50.366 align:middle
To do that run: symfony new mixed_vinyl Where

00:02:50.366 --> 00:02:54.766 align:middle
"mixed_vinyl" is the directory the
new app will be downloaded into.

00:02:55.006 --> 00:03:01.056 align:middle
That's our top-secret project to
combine the best part of the 90's - no,

00:03:01.056 --> 00:03:07.896 align:middle
not dial-up internet, I'm talking about mix
tapes - with the auditory delight of records.

00:03:08.286 --> 00:03:09.446 align:middle
More on that later.

00:03:10.076 --> 00:03:13.426 align:middle
Behind the scenes, this command uses composer -

00:03:13.676 --> 00:03:17.646 align:middle
that's PHP's package manager
- to create the new project.

00:03:17.976 --> 00:03:19.546 align:middle
More on that later.

00:03:19.846 --> 00:03:24.266 align:middle
The end-result is that we can move
into our new mixed_vinyl directory.

00:03:25.006 --> 00:03:27.356 align:middle
Open this folder up in your favorite editor.

00:03:27.716 --> 00:03:31.266 align:middle
I'm using PhpStorm and I highly recommend it.

00:03:31.966 --> 00:03:34.696 align:middle
So what did that symfony new command do?

00:03:35.526 --> 00:03:38.076 align:middle
It bootstrapped a new Symfony project!

00:03:38.436 --> 00:03:43.016 align:middle
Ooh. And we already have a git repository.

00:03:43.786 --> 00:03:48.506 align:middle
Run: git status Yep: on branch
main, nothing to commit.

00:03:49.126 --> 00:03:51.716 align:middle
Try: git log Cool.

00:03:51.766 --> 00:03:55.716 align:middle
After downloading the new
project, the command committed all

00:03:55.716 --> 00:03:57.796 align:middle
of the original files automatically...

00:03:58.256 --> 00:04:00.356 align:middle
which was very nice of it.

00:04:00.716 --> 00:04:04.986 align:middle
Though I do wish that first commit
message was a bit more rock n' roll.

00:04:05.746 --> 00:04:10.156 align:middle
What I really want to show you is
that our new project is super small!

00:04:10.526 --> 00:04:15.666 align:middle
Try this command: git show -- name-only Yup!

00:04:15.906 --> 00:04:18.006 align:middle
Our entire project is...

00:04:18.046 --> 00:04:19.806 align:middle
about 17 files.

00:04:20.266 --> 00:04:22.656 align:middle
And we'll learn about all
of these along the way.

00:04:23.256 --> 00:04:27.386 align:middle
But I want you to feel comfortable:
there's not a lot of code here.

00:04:28.156 --> 00:04:30.196 align:middle
We're going to add features little-by-little.

00:04:30.466 --> 00:04:35.096 align:middle
But if you did want to start with a
bigger, more fully-featured project,

00:04:35.246 --> 00:04:39.926 align:middle
you can do that by running that
symfony new command with -- webapp.

00:04:40.846 --> 00:04:44.266 align:middle
Before we jump into coding, let's
make sure our system is ready.

00:04:44.786 --> 00:04:52.246 align:middle
Run another command from the symfony
binary: symfony check:req Looks good!

00:04:52.736 --> 00:04:55.736 align:middle
If your PHP install is missing any extensions...

00:04:55.926 --> 00:04:57.836 align:middle
or there are any other problems...

00:04:58.056 --> 00:05:01.956 align:middle
like your computer is actually a
teapot, this will let you know.

00:05:02.036 --> 00:05:05.956 align:middle
So: we have a new Symfony app over here...

00:05:06.326 --> 00:05:08.196 align:middle
and our system is ready!

00:05:08.906 --> 00:05:11.116 align:middle
All we need now is a subwoofer.

00:05:11.446 --> 00:05:12.856 align:middle
I mean web server!

00:05:13.466 --> 00:05:18.936 align:middle
You can set up a real web server like
Nginx or something trendy like Caddy.

00:05:19.296 --> 00:05:23.776 align:middle
But for local development, the
Symfony binary can help us.

00:05:23.776 --> 00:05:28.656 align:middle
Run: symfony serve -d And...

00:05:29.096 --> 00:05:31.086 align:middle
we have a web server running!

00:05:31.416 --> 00:05:32.146 align:middle
Come back!

00:05:32.796 --> 00:05:37.446 align:middle
The first time you run this, it might
ask you to run a different command to set

00:05:37.446 --> 00:05:44.386 align:middle
up an SSL certificate, which is nice
because then the server supports https.

00:05:44.386 --> 00:05:46.096 align:middle
Moment of truth!

00:05:46.476 --> 00:05:54.026 align:middle
Copy the URL, spin over to your
browser, hold your breath and woo!

00:05:54.466 --> 00:05:56.986 align:middle
Hello Symfony 6 welcome page...

00:05:57.246 --> 00:06:00.396 align:middle
complete with fancy color
changes whenever we reload.

00:06:01.436 --> 00:06:06.516 align:middle
Next: let's meet - and become friends
with - the code inside our app,

00:06:06.856 --> 00:06:09.866 align:middle
so we can demystify what each part does.

00:06:10.326 --> 00:06:11.836 align:middle
Then we'll code.

