Coding

Laravel 5.2 PHP Build a social network – Setup & Introduction

  • 00:00:01 hey everyone now in the last week's I
  • 00:00:05 had a lot of angular2 stuff going on on
  • 00:00:07 this channel and while I really enjoy
  • 00:00:10 Englert you and I work a lot with
  • 00:00:11 front-end frameworks on my client
  • 00:00:13 projects I also worked a lot on the
  • 00:00:16 server side when I create well server
  • 00:00:19 side projects and I'm not talking about
  • 00:00:22 setting up restful services or anything
  • 00:00:24 like this
  • 00:00:24 I'm just talking about yeah blind
  • 00:00:28 simple websites which have their code on
  • 00:00:31 the server written in in my case PHP
  • 00:00:33 because I mostly work with PHP and
  • 00:00:36 that's the point I want to talk about
  • 00:00:37 I'm using lateral which is a very modern
  • 00:00:41 and not too old and very cool PHP
  • 00:00:44 framework I'm using in my projects now
  • 00:00:47 thought it would be a nice idea to to
  • 00:00:50 share some videos on level 2 because hey
  • 00:00:53 there might be people out there who want
  • 00:00:55 to get into level or who just want you
  • 00:00:58 up their development skills or what they
  • 00:01:03 can do a little bit because if you're
  • 00:01:05 just able to write PHP well you will
  • 00:01:09 have to do a lot of work on yourself
  • 00:01:11 that a framework will already solve for
  • 00:01:14 you probably safer and overall in my
  • 00:01:18 opinion it makes developing websites a
  • 00:01:20 lot more fun and you wouldn't be able to
  • 00:01:22 have a complex project if you weren't
  • 00:01:24 using a framework of some kind doesn't
  • 00:01:27 the PHP framework could also be Ruby on
  • 00:01:30 Rails but yeah frameworks are there for
  • 00:01:33 a reason and so we should use them now
  • 00:01:36 in this video and the next videos will
  • 00:01:38 create a nice little lateral application
  • 00:01:41 which won't be too complex but which
  • 00:01:44 will always showcase some of the
  • 00:01:47 strengths and of the main features of
  • 00:01:50 laravel so we'll create a little social
  • 00:01:53 network so to say where we can on the
  • 00:01:55 one side sign up and log in and then
  • 00:01:58 post things and ready to read like a
  • 00:02:02 global timeline of all people where we
  • 00:02:05 then can just like or dislike there
  • 00:02:07 posts so kind of a Facebook Twitter mix
  • 00:02:10 you could say I guess so I'm going to
  • 00:02:13 start by installing lateral which is
  • 00:02:15 really easy
  • 00:02:16 I assume you already got a development
  • 00:02:18 environment that means you got a web
  • 00:02:20 server PHP interpreter and MySQL if you
  • 00:02:24 haven't and description below you'll
  • 00:02:26 find some links which will get you
  • 00:02:28 started and you will see it's really
  • 00:02:29 easy to install packages which include
  • 00:02:31 all the things you'll need so as I said
  • 00:02:34 I assume you already gathered in one
  • 00:02:36 open environment so let's just dive in
  • 00:02:38 install laravel and get started with our
  • 00:02:40 app oh and by the way I don't have the
  • 00:02:44 app finished as now so I'm doing that
  • 00:02:46 blindly with you together because I'm
  • 00:02:48 pretty sure that is where you learn the
  • 00:02:51 most or where you can see making me
  • 00:02:54 mistakes or yeah sometimes not being
  • 00:02:57 100% consequent and you'll see hey that
  • 00:02:59 is the thing I have to watch out for
  • 00:03:00 that is something which ya can't get
  • 00:03:04 overlooked easily so see you in the
  • 00:03:07 videos heroine so I'm finally sitting at
  • 00:03:09 my desk and before I get started a
  • 00:03:11 little information for all the people
  • 00:03:13 who already know a little bit about
  • 00:03:15 laravel who are familiar with how to set
  • 00:03:18 up laravel and move the food structure
  • 00:03:20 flare well you might want to skip ahead
  • 00:03:22 and you will find a link up here which
  • 00:03:25 will get you there because now the
  • 00:03:27 beginning will I will quickly install
  • 00:03:29 their amo and then I will yeah talking
  • 00:03:32 about the folder structure and Hilaire
  • 00:03:33 over it's just a quick quick very quick
  • 00:03:35 roundup so you may skip ahead and then
  • 00:03:39 we'll meet later in the video or we'll
  • 00:03:41 start with our real application see you
  • 00:03:43 there then for all the people who are
  • 00:03:45 still there now be aware that as I said
  • 00:03:48 at the beginning of this video and the
  • 00:03:51 setup of your development environment
  • 00:03:52 will not be included in this video but
  • 00:03:55 you will find useful links in the
  • 00:03:56 description and I promise it's really
  • 00:03:58 isn't easy to get going now I'm here in
  • 00:04:00 my empty folder and I will install level
  • 00:04:03 through my terminal using composer now
  • 00:04:06 if you don't know what composer is and
  • 00:04:08 you probably don't have it then just
  • 00:04:11 google for a composer and on get
  • 00:04:14 composed record you'll be able to to
  • 00:04:18 download it and yeah as a
  • 00:04:20 here composure is really just a
  • 00:04:22 dependency manager for PHP so favorite
  • 00:04:27 line like level but also a lot of
  • 00:04:29 packages they state which dependencies
  • 00:04:32 they have because the guys from wearable
  • 00:04:36 didn't write all the code themselves
  • 00:04:38 they used existing packages and then the
  • 00:04:42 compute ate it in like a special file
  • 00:04:45 adjacent files specifically and composer
  • 00:04:49 is a software which will then scan
  • 00:04:51 through that file find your dependencies
  • 00:04:53 find them in the internet the most
  • 00:04:55 recent version or a version you
  • 00:04:57 specified in your file and download it
  • 00:05:01 get everything in your folders that you
  • 00:05:03 were ready to start so a really really
  • 00:05:06 helpful tool for for managing your
  • 00:05:09 dependencies I already have composer but
  • 00:05:12 if you don't as I said just download is
  • 00:05:14 here follow the instructions you see
  • 00:05:16 here and you should be good to go now
  • 00:05:19 what I'll do I'll just open up my
  • 00:05:21 terminal here and I will execute
  • 00:05:24 composer create project another project
  • 00:05:30 is lateral slash level this will install
  • 00:05:34 it and I specify prefer just to make
  • 00:05:37 clear that I wanted to be downloaded and
  • 00:05:39 installed on this folder here so now
  • 00:05:43 composer will get going and as you can
  • 00:05:46 see it is now installing level and it's
  • 00:05:50 yeah it's fetching it's downloading all
  • 00:05:52 the dependencies
  • 00:05:53 I'll need and that will take some time
  • 00:05:55 so I'll see you once this is finished so
  • 00:05:58 my setup just finished and if I just
  • 00:06:04 RiRi let us refresh this over here we
  • 00:06:07 can see that we get all these files and
  • 00:06:09 folders here now they're inside the
  • 00:06:12 lateral folder that's just a default and
  • 00:06:14 I would just move them up one folder I
  • 00:06:17 simply do this by typing MV for move
  • 00:06:21 laravel all everything that isn't an
  • 00:06:25 aural folder just dot just to the
  • 00:06:27 current folder so yeah that worked and
  • 00:06:31 now I can
  • 00:06:32 I must check hurry up now that left out
  • 00:06:39 there is dot files here those are
  • 00:06:41 important too so let's just manually
  • 00:06:43 move them up so that my lateral folder
  • 00:06:47 is actually completely empty now that
  • 00:06:52 should in theory work yeah so now I can
  • 00:06:56 get rid of malarial folder here and now
  • 00:06:59 I'm good to go
  • 00:07:00 now if you see if that worked you want
  • 00:07:02 to fire up your your browser and
  • 00:07:04 navigate to wherever your local
  • 00:07:07 development environment is bound to sell
  • 00:07:10 so Evert you specific host if you bound
  • 00:07:13 to that so wherever you normally
  • 00:07:16 navigate for your projects and there you
  • 00:07:19 wanna navigate navigate to your little
  • 00:07:21 folder and then you have to target the
  • 00:07:24 public folder that's important if you're
  • 00:07:27 a URL or if you're just navigating to
  • 00:07:30 this level folder you won't see anything
  • 00:07:32 or just an error because level is
  • 00:07:35 serving it's files from this public
  • 00:07:37 folder so another way would be to set it
  • 00:07:41 up such that your server is already
  • 00:07:44 pointing to the public server and all
  • 00:07:46 your application files so to say our one
  • 00:07:49 directory above so that will be how you
  • 00:07:52 set it up on a web server so I'll go to
  • 00:07:55 my file here and now you should see this
  • 00:07:59 lateral five message which means hey it
  • 00:08:01 was successfully installed now by the
  • 00:08:04 way if that was a little bit too fast
  • 00:08:07 for for how to set all that up again
  • 00:08:11 please look in the description there
  • 00:08:13 will be useful links provided there let
  • 00:08:18 me clear a step and that is our very
  • 00:08:20 first level application let default we
  • 00:08:23 see when it's starting up now that be
  • 00:08:26 quickly guide you through all these
  • 00:08:28 folders and files we got here we got a
  • 00:08:31 rap folder this is where we will write
  • 00:08:33 the majority or a bit all our business
  • 00:08:37 logic will live in this app folder we
  • 00:08:39 will
  • 00:08:39 that about routing or control us in this
  • 00:08:41 folder the bootstrap folder is something
  • 00:08:44 we won't touch most of the time the
  • 00:08:47 config folder we got several parts of
  • 00:08:50 our lateral application which we can
  • 00:08:52 configure like for example the offering
  • 00:08:54 authentication package or general
  • 00:08:58 configurations for the whole app at the
  • 00:09:01 moment we don't have to do anything here
  • 00:09:02 in the database folder there we can use
  • 00:09:05 a very cool feature of Larry law namely
  • 00:09:07 one to create database migrations which
  • 00:09:11 are PHP files which define or declare
  • 00:09:14 how a table in a database should look so
  • 00:09:18 which feels it should have and how these
  • 00:09:20 fields are configured so stuff you
  • 00:09:23 normally would do either through like
  • 00:09:25 graphical interface like PHP myadmin or
  • 00:09:28 directly through SQL in this case we can
  • 00:09:34 write a PHP file and then use the
  • 00:09:37 lateral command line tool which we'll
  • 00:09:39 see soon and to execute that file and
  • 00:09:43 that will create all that the sequel
  • 00:09:46 code we need and will automatically
  • 00:09:48 write it into the database so very easy
  • 00:09:50 and intuitive way of setting up database
  • 00:09:54 so that's that's one of the greatest
  • 00:09:55 features in my opinion of flair well a
  • 00:09:57 very great feature at least the public
  • 00:10:00 folder is something we won't have to do
  • 00:10:03 much there
  • 00:10:04 however we will soon set up our source
  • 00:10:07 directory for our CSS and JavaScript
  • 00:10:10 files in our recent resources folder
  • 00:10:13 well we got this assets folder where we
  • 00:10:16 could use SAS or SPSS if we wanted you
  • 00:10:20 and Laurel ships with a default galled
  • 00:10:24 file here and the app CSS file so if you
  • 00:10:27 want to use it it's kind of built in but
  • 00:10:30 I will get rid of that and I will use
  • 00:10:34 even my own a gulp file on my own gulp
  • 00:10:38 workflow or I'll just in this toilet
  • 00:10:41 just write pure CSS so but we could use
  • 00:10:45 this assets folder to have dread up I
  • 00:10:47 mean compiled version of our CSS and our
  • 00:10:50 javascript and setup our god workflow or
  • 00:10:54 whatever you're using to copy them into
  • 00:10:56 a source folder in the public directory
  • 00:10:59 that the language folder the land folder
  • 00:11:02 we can set up translation yet file so to
  • 00:11:07 say so if you look in one of those files
  • 00:11:09 it's basically an array which has a key
  • 00:11:11 and then the text to be displayed and
  • 00:11:14 they could specify additional language
  • 00:11:16 is here obviously and we would have to
  • 00:11:19 need each file and each key then for
  • 00:11:24 every language you want to specify so
  • 00:11:26 that we can provide a perfect
  • 00:11:28 translation but we'll stick to English
  • 00:11:30 in in this application here now the fuse
  • 00:11:33 folder that's a very important one here
  • 00:11:36 we will create or refused so what gets
  • 00:11:38 rendered to the screen lateral ships
  • 00:11:41 with its own templating engine the blade
  • 00:11:44 templating engine that's why this file
  • 00:11:46 is called blade dot PHP and that's
  • 00:11:50 basically just a templating engine yet
  • 00:11:52 like you might know others like smarty
  • 00:11:54 for example where you create your fruit
  • 00:11:57 views from several components which are
  • 00:12:00 then stick together and you have a very
  • 00:12:03 structured way of accessing data you
  • 00:12:05 might pass into those views so that's a
  • 00:12:08 cool thing to Alera
  • 00:12:10 and all our fuse will live in this fuse
  • 00:12:13 folder here as you can see it currently
  • 00:12:16 has this welcome view which if we have a
  • 00:12:18 look at it it's just has level 5 and
  • 00:12:21 that's exactly the few were seeing here
  • 00:12:23 it also has I think one year one error a
  • 00:12:27 few it already has defied and here in
  • 00:12:30 this vendor folder if we were to install
  • 00:12:33 additional packages those packages might
  • 00:12:36 publish views which are part of the
  • 00:12:39 package which would then go also in that
  • 00:12:41 vendor folder where we could edit them
  • 00:12:43 if we wanted you because we should never
  • 00:12:46 ever end that as the vendor folder if I
  • 00:12:48 briefly skip those two I'll come back to
  • 00:12:51 them in a second in the vendor folder
  • 00:12:53 all our dependencies live all the
  • 00:12:55 packages were using live including the
  • 00:12:57 labral framework oops
  • 00:12:59 including the laravel framework itself
  • 00:13:01 you can see it here
  • 00:13:02 and we never never want to attach
  • 00:13:05 anything inside here that are the files
  • 00:13:09 s they were installed by composer and
  • 00:13:12 those will only be changed if we run
  • 00:13:15 composer
  • 00:13:15 update or anything like this yeah we
  • 00:13:17 might install new and also remove
  • 00:13:20 unwanted or unnecessary packages but we
  • 00:13:23 should never mess with any content here
  • 00:13:26 because it will be overwritten if you
  • 00:13:29 run an update and we don't want to do
  • 00:13:31 that also if we mess something up there
  • 00:13:34 it might be very hard to find that out
  • 00:13:36 so most packages or old packages that
  • 00:13:40 want you to added stuff will add a
  • 00:13:43 possibility for you to use a certain
  • 00:13:46 command in the level command line
  • 00:13:49 interface I will show you that in a
  • 00:13:51 second which will publish all the things
  • 00:13:55 you should be able to change into one of
  • 00:13:59 those folders here so that's very
  • 00:14:01 important to keep in mind now the
  • 00:14:05 storage folder here that holds yeah for
  • 00:14:09 example the cache of your app and yeah
  • 00:14:13 that s generally it also some files
  • 00:14:16 might be stored there as what the name
  • 00:14:18 says it's a storage and tests folder
  • 00:14:21 well that is if you're running unit
  • 00:14:23 tests well you will do that in that test
  • 00:14:25 folder so that'll fit all the folders
  • 00:14:30 let's briefly talk about those files and
  • 00:14:33 don't worry I'm not going to go through
  • 00:14:36 every file to be honest I'll only talk
  • 00:14:39 about two files the first one is the dot
  • 00:14:41 e MV file that file provides a basic
  • 00:14:44 configuration for our app for example
  • 00:14:46 we'll set up our database connection
  • 00:14:48 here and yeah for if we were to use
  • 00:14:52 mailing we would also set a set of our
  • 00:14:54 mail server here so additionally to our
  • 00:14:57 config files here that's like the
  • 00:15:00 quickest way to set up some basic yep
  • 00:15:03 connections mainly as you can see anti
  • 00:15:07 artists and file where that is not
  • 00:15:09 important on its own but the are titian
  • 00:15:13 file or command is like to come
  • 00:15:16 and line unilateral and we access it by
  • 00:15:19 writing PHP artisan and then whatever
  • 00:15:23 command and we will look into those
  • 00:15:25 commands obviously throughout our
  • 00:15:26 application we can for example create
  • 00:15:29 new models or database migrations
  • 00:15:32 speaking of models migrations views and
  • 00:15:35 controllers level is a MVC framework as
  • 00:15:39 you might have probably guessed by now
  • 00:15:41 and as such we have that strict
  • 00:15:44 separation between or yeah between view
  • 00:15:48 model and our controller and this is how
  • 00:15:50 we will structure our laravel apps
  • 00:15:53 enough of the talking we got our level 5
  • 00:15:59 few here at the moment and i as i said i
  • 00:16:03 want to build an application where we
  • 00:16:05 have like a mini social network we have
  • 00:16:08 a stream of of posts and we can post or
  • 00:16:14 create posts ourself and we will be able
  • 00:16:18 to see all the posts of all our people
  • 00:16:21 posting things we can then like and
  • 00:16:24 dislike those posts and yeah we will be
  • 00:16:28 able to sign up and or sign in if we are
  • 00:16:31 already signed up so what are the core
  • 00:16:35 features we have well we need some kind
  • 00:16:37 we need a database to store our users to
  • 00:16:40 store our posts and to store our likes
  • 00:16:43 and dislikes so that's one thing um we
  • 00:16:46 also need some kind of authentication
  • 00:16:49 logic because our user should be able to
  • 00:16:54 first sign up and then when they were
  • 00:16:57 created they should be able to sign in
  • 00:17:00 and we also need to be able to check for
  • 00:17:02 certain functions to be available if the
  • 00:17:06 user is signed in so that's something
  • 00:17:08 which we will have to take care about
  • 00:17:10 this authentication thing and you will
  • 00:17:12 see we won't have to take care about
  • 00:17:15 that much because lair or goddess err
  • 00:17:19 yeah so we have to create our different
  • 00:17:21 views for posts for signing up and
  • 00:17:24 signing in for creating posts so a lot
  • 00:17:28 of stuff were very
  • 00:17:30 using models controllers fuels who have
  • 00:17:32 routing because we all have different
  • 00:17:33 views where we have to route – depending
  • 00:17:36 on the user's reaction we obviously as I
  • 00:17:39 said have authentication we might throw
  • 00:17:42 in maybe let's see some some mailing
  • 00:17:45 that we get sent a mail when we sign up
  • 00:17:47 so even though it's not the comm most
  • 00:17:50 complex application out there it already
  • 00:17:53 has quite a lot of features you will see
  • 00:17:58 in in yeah in day to day applications
  • 00:18:01 out there now enough of the talking now
  • 00:18:04 the video is already quite long what I
  • 00:18:08 want to do is first let's talk a little
  • 00:18:11 bit deep were different the various
  • 00:18:13 views I mentioned so we get our welcome
  • 00:18:15 view here and we will have kind of
  • 00:18:18 welcome for you in our final application
  • 00:18:21 to which they'll basically say whatever
  • 00:18:25 we should log in right because we only
  • 00:18:27 want to be able to see post if we're
  • 00:18:28 logged in so kind of Facebook if you're
  • 00:18:30 not locked in or not signed up well
  • 00:18:33 you're not to able to do much yeah there
  • 00:18:36 are public pages but in our application
  • 00:18:38 we'll only be able to see something once
  • 00:18:41 we're locked in so we should maybe just
  • 00:18:44 added this default view of it so that it
  • 00:18:50 is not final version because we will
  • 00:18:52 need some styling and that will take a
  • 00:18:54 little bit longer but just so that we
  • 00:18:56 yeah feel the direction we're going to
  • 00:19:00 so let me first get rid of all my of all
  • 00:19:05 that here or and of the container def or
  • 00:19:08 two and here of the styling I won't need
  • 00:19:13 that fund here um what I want to do is
  • 00:19:16 and that's the first thing about lateral
  • 00:19:19 views or about the templating engine
  • 00:19:21 more I want to have a skeleton file like
  • 00:19:25 a basic layout which I can then reuse in
  • 00:19:28 my different pages because my usual
  • 00:19:33 login page will will be an html5
  • 00:19:36 document it will require my styling
  • 00:19:38 sheet and so on so basically this
  • 00:19:42 skeleton here
  • 00:19:43 yeah that that's the same for each
  • 00:19:45 document more or less right and there
  • 00:19:47 might be other parts like for example a
  • 00:19:50 header which will be the same for many
  • 00:19:52 pages at least and so on so what I want
  • 00:19:55 to do here is I will create a basic
  • 00:19:58 layout which my different views can then
  • 00:20:00 extend and pull in the the functionality
  • 00:20:04 or the document structure provided in
  • 00:20:06 the layout and add additional
  • 00:20:08 information or the really core of the
  • 00:20:11 future with them so therefore I just
  • 00:20:13 copy all that I'll create a new folder
  • 00:20:16 in my views folder which I will call
  • 00:20:18 layouts and inside this layouts folder I
  • 00:20:22 just want to create a master dot plate
  • 00:20:24 or PHP and it's important you have to
  • 00:20:27 use the plate to PHP if you want to use
  • 00:20:30 the blade templating engine you don't
  • 00:20:31 have to use that you can write normal
  • 00:20:34 PHP code but in this course we will use
  • 00:20:37 it because I'm a fan of it I like it I
  • 00:20:40 think it's it's a really cool way it
  • 00:20:43 makes things easier it's it's well
  • 00:20:44 thought so yeah I like it
  • 00:20:47 in this master file here let's just copy
  • 00:20:50 the skeleton I just yeah I just copied
  • 00:20:53 here right get rid of it in the Welcome
  • 00:20:56 view and in my master view here first
  • 00:21:00 what I want to do is the title it's not
  • 00:21:03 really part of the master layout but it
  • 00:21:07 should be inserted by the individual
  • 00:21:10 view right because we will have a
  • 00:21:12 different title in the please sign up
  • 00:21:15 document and a different title in that
  • 00:21:19 are all posts document so therefore we
  • 00:21:22 kind of have to provide a hook in the
  • 00:21:24 skeleton here and we'll use a blade
  • 00:21:28 templating function so to say our
  • 00:21:31 expression which is the following
  • 00:21:35 at yield and then title here in an
  • 00:21:39 equation marks and that's a typical
  • 00:21:42 blade templating engine expression they
  • 00:21:45 always start with an @ sign so that
  • 00:21:48 means hey here comes a blade templating
  • 00:21:51 expression then comes the special
  • 00:21:55 command
  • 00:21:56 thanks you want to use so in this case
  • 00:21:58 it's a yield function which says here
  • 00:22:02 should be something something should be
  • 00:22:04 inserted here hi I'm a place holder so
  • 00:22:07 to say and then we have a name for the
  • 00:22:10 place holder which is title and in our
  • 00:22:12 brief use we'll be able to access that
  • 00:22:15 title through this placeholder name here
  • 00:22:17 and actually and insert our content and
  • 00:22:21 we'll do that in a second because we'll
  • 00:22:23 obviously also need this in our body
  • 00:22:25 here right but because especially in the
  • 00:22:27 body
  • 00:22:28 we'll need to insert our actual content
  • 00:22:31 what I'll do is I'll create a container
  • 00:22:33 div which will be wrapped about around
  • 00:22:36 our content all the time so that hasn't
  • 00:22:38 to be part of the actual few what will
  • 00:22:42 be inserted here and then again I use
  • 00:22:44 yield and I'll give that a name of
  • 00:22:46 content and obviously those names are
  • 00:22:48 purely up to you you could name this
  • 00:22:51 sugar-boy if you want it but I think
  • 00:22:53 titles a little more more intuitive
  • 00:22:57 maybe so here our content will live let
  • 00:23:01 me save this
  • 00:23:01 and if okay we go to our welcome whew I
  • 00:23:05 will now have to extend this master
  • 00:23:09 layout and I will do so by writing
  • 00:23:12 extends at extends again a blade
  • 00:23:16 templating expression then the path to
  • 00:23:21 the file we're extending from so in this
  • 00:23:24 case it's in the layouts folder so first
  • 00:23:26 I write layouts followed by a dot to
  • 00:23:30 kind of access that folder and then I
  • 00:23:32 have my master 4 file and I only write
  • 00:23:36 master without top light dot PHP so I
  • 00:23:39 always leave out that top light dot PHP
  • 00:23:42 part so that extends from that file but
  • 00:23:45 I'm not inserting anything now if I'm
  • 00:23:48 just writing like that
  • 00:23:49 I won't insert into specific sections of
  • 00:23:53 the layout I target a section by using a
  • 00:23:57 number expression at section and here I
  • 00:24:01 specify which section and now the key I
  • 00:24:04 enter a year for example title always
  • 00:24:08 has to fit the key
  • 00:24:09 off the section here defined of the
  • 00:24:12 yield function where I want to enter my
  • 00:24:14 content so I'm entering my my title
  • 00:24:19 section here and I'm closing it with n
  • 00:24:22 section and this will tell level or the
  • 00:24:26 blade's templating engine that
  • 00:24:28 everything between the opening section
  • 00:24:31 and the closing section tax so to say
  • 00:24:34 will be inserted right here instead of
  • 00:24:37 that ad yield
  • 00:24:38 title so here we will have cut just
  • 00:24:42 welcome now I'm going to copy that and
  • 00:24:46 below title I'll do the same for content
  • 00:24:51 and I'll just write this is the content
  • 00:24:54 save this and now I'm inserting this
  • 00:24:58 into the section content which is in my
  • 00:25:02 layout defined here with yield content
  • 00:25:05 so if I now reload my view here you'll
  • 00:25:09 see that we get welcome exclamation mark
  • 00:25:13 as a title of this page and this is the
  • 00:25:15 content as the content and now while
  • 00:25:19 that page doesn't look super awesome
  • 00:25:22 what we did is a very interesting and
  • 00:25:25 very foundation of using fuse at least
  • 00:25:29 when using the plate template again
  • 00:25:31 channel arable which allows X exactly
  • 00:25:34 that to define a skeleton and then just
  • 00:25:39 use components to create our fuse so we
  • 00:25:43 might have another file where we have a
  • 00:25:45 different content and we could just copy
  • 00:25:47 that and throw in the other content in
  • 00:25:49 the other file so that's the real
  • 00:25:51 powerful feature of the templating
  • 00:25:54 engine and yeah as I said I really like
  • 00:25:57 it and it's it's enabling us to quickly
  • 00:26:02 create and it will also change fuse and
  • 00:26:05 you only have to make changes in one
  • 00:26:08 place because you're not copying code
  • 00:26:10 over and over again because don't repeat
  • 00:26:12 yourself very important paradigm ok so
  • 00:26:17 that's quite a long video 30 minutes or
  • 00:26:21 something like that 20
  • 00:26:23 five I guess but I think that was very
  • 00:26:26 important now
  • 00:26:27 we're familiar with the structure of
  • 00:26:31 Lera well how to use to play templating
  • 00:26:33 engine and where to edit files to
  • 00:26:37 actually change what is displayed here
  • 00:26:39 in our browser it in the next video
  • 00:26:43 we'll get going with our actual
  • 00:26:46 application and we'll start building
  • 00:26:48 that so see you in that video and have a
  • 00:26:51 nice day bye