As I mentioned in the previous post, I decided to make a post based on what I've learned from freeCodeCamp's full course video. If you search "Laravel" on YouTube, this video came up first. This is more like a notes for myself so I don't quite recommend people to take this as guide, if you found my blog in google search. But if you follow the same course as me, only then this maybe could help you out a little bit.
I kinda take a risk here for choosing that video to learn because it was uploaded in May 2019, still on Laravel 5 when there's already Laravel 8 now but one user's comment caught my attention:
For anyone who is starting this project and you are wondering if it is worth it ? It is 100 % worth it - Alex Fancy
In a heartbeat, I choose to proceed. I don't know if I'm too easy to convince or just lazy to search for other video. I thought I would just Googled any error I will come across. Perhaps I will gained extra knowledge from doing that. By the way, I'm going to really take my time in learning this framework. Watch some bits and immediately make notes because I really really want to truly understand it, rather than just following whatever the instructor do blindly. In my experience, knowledge don't stay long with me if I do the latter.
Oh God, that's a long introduction.
In this post, I covered from minute 0:00 until 11:00 of this video.
In the course, we're going to create an Instagram clone, a 100% from scratch while also learning the basics. To me, it's like killing two birds with one stone. The project will be able to:
- Follow/unfollow user
- Edit profile and change profile image
- Resize image from scratch using Intervention
- Add a new post and insert caption
- Authentication such as login, logout, forgot password and register
laravel new YOUR_PROJECT_NAME
. This will create YOUR_PROJECT_NAME
directory containing a
fresh Laravel installation with all of Laravel's dependencies already
installed. I created and named my project MySite
. The
installation is going to take some time.
cd YOUR_PROJECT_NAME
. A LOT of files were created in the
directory and it seems really daunting. But the instructor ensured this will
become your second nature overtime. I hope so!
composer.json
, located in the root directory. This file holds our
project assets. It means, when we are using dependency manager which is the
Composer, the Composer itself also needs instructions. And that is what this
file is for. But we will probably never touched a lot of the stuff in the
file.
php artisan
(make sure that you are inside
your project directory). After you run it, you will see a bunch of list. These
list is all the command you can use to do all the different things to our
application like was said earlier. To give you the better idea of it, run
command php artisan serve
. It will then output an address. Copy this address and try open it in your
browser.
welcome.blade.php
.
Highlights ⚡
laravel new YOUR_PROJECT_NAME
for starting a new projectphp artisan
for command listphp artisan serve
to start development server- Anything HTML-related is saved in view
-
View is stored in resources > views with
.blade.php
extension - View does not contain computation or fetching
- Blade does not restrict you from using plain PHP code in view
No comments:
Post a Comment