Thread Contributor: Baredee[TUT] 2 - Installation - Laravel Tutorial Series
#1
If you didn't catch the last tutorial, you can view it here

~~~~Hey, everyone! :)~~~~


Welcome to part 2 of the Laravel TuT series - we're going to begin with Installation





Installation

Installing Laravel isn't difficult. You can follow the instructions on their website: http://laravel.com, you can watch
various videos on youtube for the specific platform you're using. I'll be using Windows, so if you're fortunate enough to
have the same OS installed, you won't need to do anything differently unless otherwise necessary...


It's apparent on the laravel documentation that we need a server with the following facilities:

PHP >= 5.6.4
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension

I suggest using XAMPP or WAMP, I'm personally using the latter for this particular tutorial -> http://www.wampserver.com/en/

So install that, ensure no other similar service is running on the same port (conflictions happen) - and just turn on Apache and Mysql.

We don't need Apache because Laravel's Artisan will take care of the server for us, however - if we want to view our database with through a GUI,
we'll need to enable localhost:80 to access /phpmyadmin.

Assuming that you're now running WAMP, with apache:80 and mysql:3306, you should be able to see http://localhost and http://localhost/phpmyadmin

If you do, that's your database now set up, if you don't, post in the comments & we'll try to work out why, together.


OK. Now let's actually install laravel lel.


Install this. https://getcomposer.org/ -> it's basically a package manager for PHP, like NPM for node.

Psst! Remember to add it to PATH so that you can run `composer` in your terminal/cmdl

If you don't know how to do that, check out my thread


Once you've installed Composer, run the following command to install Laravel.


[Image: 964d9c6f2edc455fb460639a46d8fcc9.png]


Voila... you now have a PHP packet manager (Composer), the actual framework (Laravel) and an additional localhost server/db for developing (WAMP)

To initialise an application, CD to your preferred working directory (~/./Desktop/etc.) and run `laravel new name_of_your_project`

For this tutorial, I'll do 'laravel new vtech' - check it out:


[Image: 9c48ec2e847a4db59d6f104513e1eb36.png]


Laravel will begin to install its dependencies and build up its folder structure:


[Image: 1698600a6df04b8784d30f98507f1587.png]


Wait until it finishes and tells you to build something amazing.


[Image: 14cc971a12304c9d81837b26061311f9.png]


See that key that it gives you? Don't show it to anyone, it is the key that laravel uses to encrypt data in your application.
Letting it fall into the hands of another may facilicate the decryption of data in your app - resulting in chaos.


Next, open your newly created project folder in your Text Editor.


I'm personally using Sublime Text 3 (with Material Theme in case you ask later on) so I'll do this:



[Image: 87e6cce960604c448084fe7b30c7c547.png]


and now my project is opened in Sublime Text



[Image: d162b5e79ecf4b138c34418fa152247e.png]




Let's quickly cover Documentation interpretation and then move unto Folder Structure so we can
understand what exactly is going on with all those files and folders.





Documentation interpretation

Not too sure why I made this a section as the docs for laravel are fairly easy to understand.

Link -> https://laravel.com/docs/5.4

They have categories and then sub-categories as well as a search system. Familiarise yourself with the terminology of
Laravel's elements and components (some of which will be mentioned in this tutorial) and you will hopefully be able
to efficiently find what you're looking for in the documentation.

Side note -> it's actually quite beneficial to get used to interpreting documentation, not just replies from others for your specific issue.

Ok, onto Folder Structure





Folder Structure

I understand that the folders and files may be intimidating at first, but don't think that you need to digest it all
right now. Let's just focus on what we need to know.

Everything is in vtech... let's get that out of the way, lol.

app/ -> one the folders we'll spend most of our time in - it contains our models and controllers, and middleware. (dw I'll show you!)

config/ -> contains configuration files, we'll put our database details in here somewhere. - won't deal with it much

database/ -> this is where we create migrations, factories, and seeders, won't use too frequently, but I might cover this

public/ -> where we keep our files, CSS/JS/IMGs etc.

resources/ -> if you're doing the designing of the html/css, you'll probably spend most of your time here, it's where the views will rest.

routes/web.php -> Ignore the other files for now. We'll be using this file to create our endpoints.

I truly think that's all you need to know for now, folder-structure-wise...





Conclusion

I'd like to conclude this part here, to avoid discouraging anyone by posting a longgg tutorial like I usually do.
So we'll carry on in the next tutorial, working with Endpoints and onwards. As always if there's something
that confuses you or inspires any questions, feel free to leave your questions below and I'll attempt to answer to
the best of my ability...

hope you enjoyed, peace!




[Image: a701e0ca783f4720a2616a0d57f28e3b.png]


Possibly Related Threads…
Thread Author Replies Views Last Post
[TUT] 7 - Updating & Deleting / Wrapping up - Laravel Tutorial Series Baredee 6 5,397 05-12-2017, 10:59 AM
Last Post: Baredee
[TUT] 6 - Form->Database - Laravel Tutorial Series Baredee 6 4,884 03-30-2017, 12:00 AM
Last Post: Baredee
[TUT] 5 - Migrations & Schemas - Laravel Tutorial Series Baredee 0 1,396 03-01-2017, 06:46 PM
Last Post: Baredee
[TUT] 4 - Models & Controllers - Laravel Tutorial Series Baredee 0 1,450 02-28-2017, 06:28 PM
Last Post: Baredee
[TUT] 3 - Artisan / Routes / Blade - Laravel Tutorial Series Baredee 0 1,365 02-27-2017, 03:31 PM
Last Post: Baredee

Forum Jump:


Users browsing this thread: 1 Guest(s)