Tip:
Highlight text to annotate it
X
Hi guys welcome to the second edition of
the Laravel PHP course.
In this episode I'm just going to quickly to show you how to install Laravel.
There's two ways of doing it.
There is the zip file way; which is going to GitHub
and getting Laravel
from this here
Just download the zip and extract it
into your folder.
Or, in our case we are going to use composer.
(Which is my preferred way)
So, how we do is we will launch
a PowerShell & you will want to navigate to
Where the root of your sites are.
If you see in here I have various little things going on there.
But, what I actually want to do
is I want to install it
into this Laravel folder here. Ok?
so ....
Oh apparently it doesn't want to clear :/
There we go. Errr ...
so
to do this, if you have installed Composer globally and successfully
(which if you watch the last video you'll how you will have done that)
You just type: composer
Ok? And then
you need to create a project (create-project)
the project is
laravel
slash laravel (Example: 'laravel/laravel')
this is kind of
people and then project name
Microsoft
Windows
It's [Organisation or name] / [Project name]
and then the folder you are going to then
put it in,
(which needs a space)
and I made one called 'laravel' just to confuse you, it could be any folder you like and I
believe make the folder
if you choose just any name. It's up to you which name you use
you might want to follow what I've done. OK?
And then, at that point
just hit enter
and it will work its magic. Now you can go and
make a cup of coffee at this point
and then come back! Or if you're super
paranoid like I am, you can watch the whole thing
develop but it will take a few minutes ok?
So I'm going to pause the video here
and err ... actually it's doing it very quickly?
Ah right! loading everything cache for me because I had a little
try before; which is quite clever .. erm
but it will take a bit longer for you. You'll see it actually
give you a percentage when downloading each part.
So in that case just gonna wait :)
No time for a coffee!
I'll have to get one afterwards.
so what this is doing at the moment is it's installing different packages;
some of these would work on their own.
So ... err ..
for instance
like swift mailer
and I believe
the core of
symphony is here as well look
ok?
so we're gonna get a lot of messages at the end
its
giving me a lot lot of suggestions. We'll ignore that for now.
we just want to get this running. So if we
go into our Laravel folder
we shall see, if we list everything, that we now have
a ton of files, and, more importantly, we have a
conposer.json file. This holds
information about err ...
well let's have a look at it
so let's ...
go into Laravel (folder)
and this [editor] is Sublime Text (I forgot to mention)
if you don't have an editor that does highlighting already
I can't image that you wouldn't but if you don't,
this is Sublime Text. You can use it for free but it will
press you every now and again to
buy a licence, which I have
because I feel this piece of software
is worth every penny. If you're a cheep-skate and you don't want to pay anything,
which is fair enough look up Notepad++
and use that. It is very similar but not the same.
So .. what was I doing? Oh yeah, we're going to have a look at this composer.json
file ... and
and it ...
Basically it's like a setting file and
Composer can use this to .. erm
to figure out what it needs and what it doesn't need
(quite a lot of the time) :P
So your next step
.. after ...
doing that create project
is
installing that has any kind of
dependencies
and all you do for that is
when you
are in the right folder [for your project] you just want to type:
composer install
and this command all install all the dependencies [via autoloader]
that are mentioned in this json file here
which you don't need to worry about too much at the moment.
So we're going to just run this and
see what happens
and it's ...
"Nothing to install or update" and
"Generating autoload files"
and "Generating an optimized class loader" which we'll get into.
OK so once that is done, it's now time to see
if we have got this all right, or, if we have made a complete mess of it!
so
launch your favorite browser;
we're already here [URL]
if I load this one [root directory] up we're
probably get a directory listing; which we do.
That's because we haven't got any kind of
magic-pretty-URL stuff going on yet
further down the line business. So,
to go to /public
where there is a test.php [meant to say index.php]
you get a nice logo and "You have arrived." Once you reach
this point you can do a lap of honour around the room
and
glass of wine, maybe, something. But have a good
celebration, you installed Laravel correctly.
Okay so in the next video we're going to look at the files downloaded
and we're going to have a little tour
as to .. er ..
what each folder
is for but
not every single file but
we'll get a general idea
what's going on. See you in the next video!