Fixing Static Assets0:00
Now that we have extracted all of the feed items and we are supplying at least some information to those, we need to extract the replies to those items. The first thing I want to do is be sure that we are loading the assets that we need, like the fonts as well as the static image that is down at the bottom in the footer. And this is gonna be easy not to fix. In fact, I should have thought about this whenever we first set up our project.
In fact, I should have thought about this whenever we first set up our project. You know, I put all of the static assets inside a public and really they should be inside of resources. So I'm just going to paste those in there. But we do need to make a few modifications. One of those is inside of app.css because this is where the font is defined. So all we need to do is change the URL so that it is resources/fonts and then the name of the font.
So all we need to do is change the URL so that it is resources, fonts, and then the name of the font. And then we need to go to the feed view as well as the profile view. And down at the bottom inside of the footer, we need to change the URL for the white noise. So we'll just tack on resources to that URL and then that should fix our problem. Now ideally we would extract footer so that we would only have to do that once,
Now ideally we would extract footer so that we would only have to do that once, but you know, we'll get to that. If we need to get to that, we need to be sure that those assets are being loaded. And sure enough, they are, I can tell right off the bat that our fonts are being loaded and if we scroll all the way to the bottom there is the white noise. So great. We are okay.
Extracting Reply Partial1:39
to the bottom there is the white noise. So great. We are okay. And now we just need to extract the reply markup. So we don't need profile, we don't need feed, we just really need feedItem. But let's go ahead and let's create a new file. We'll call it feed_item_reply.blade.php. I don't know if I like that, but at least it tells us what it is.
I don't know if I like that, but at least it tells us what it is. And I guess that's the, the most important thing. So now we just need to find where the reply markup starts. So it's right here and we have this LI element. So it's going to be very similar to extracting the the uh, feed item markup, but in this case it's going to be a little bit different. Now, for whatever reason, Visual Studio Code does not let me collapse this LI element.
Now, for whatever reason, Visual Studio Code does not let me collapse this li element. So if we collapse everything else inside of the li element, we should be able to find the closing li tag. So let's cut that out and let's paste it inside of feedItem. And then this is going to give us the ability to just close this file because we won't need it. However, you know, let's do this. We want to iterate over the itemReplies.
However, you know, let's do this. We want to iterate over the itemReplies as reply, and then we would include the partials/feedItem reply. Then we would pass in. What, how would we do this? Uh, I guess we would pass it in as item because we used the term item here inside of feedItem. So that way, you know, there's at least some commonality between these two things.
Adding Reply Data3:27
So that way, you know, there's at least some commonality between these two things. So that'll be fine. So our item will be the reply and then we just need to close out the foreach so that I think that's gonna get us, so that now what we need to do is actually have some replies. So let's go back to, we will start with the feed route. So the feed item is going to be almost exactly the same as a reply,
So the feed item is going to be almost exactly the same as a reply, because a reply is just another Post. That's all it is. It's just going to be a reply to another Post. So basically the structure is going to be the same except that we will have a replies key. And that's going to be an array of Post objects. So we're gonna have a profile, we're gonna have a lightCount,
So we're gonna have a Profile, we're gonna have a lightCount, we're gonna have all of that stuff. So I'm just gonna copy some of that and paste it in. And then we will just make some changes, like for the lightCount, you know, let's use some different values just so that we know that everything is gonna be, you know, pulling data correctly. So it doesn't matter what the likeReply
pulling data correctly. So it doesn't matter what the like reply and repost counts are, just arbitrary values will be fine, but the profile is gonna be a little bit different because the reply is from Simon, I believe. So if we scroll all the way up, uh, yes, avatar of Simon. So as far as the name of the avatar, all we need to do is change that value. The display name is Simon, and his handle, I believe is SimonSwiss.
Wiring Reply Markup5:03
The display name is Simon, and his handle, I believe is Simon Swiss. So that gets the profile stuff out of the way so that inside of our markup, we could just go ahead and, and start outputting that. So as far as the avatar is concerned, we would have item and then profile and then avatar. And then we would need that same thing for the display name, which is just Simon. And then we need that to output Simon down here.
which is just Simon. And then we need that to output Simon down here. But then, let's see, we almost have to take this line by line. I say we, I almost have to take this line by line to be sure that I don't miss something. And here is that uh, dateTime value. That's not part of the profile and I don't remember what this was. Maybe it was postedDateTime.
and I don't remember what this was. Maybe it was posted_date_time. If not, we'll come back and we'll change that. And then we have the handle there. So we will replace the actual handle with whatever is the handle from the profile. So that gets that taken care of. Then we need to get to the action buttons, which if we keep scrolling down, there we go. So here we will have the like_count.
which if we keep scrolling down, there we go. So here we will have the likeCount. So we'll have that. Then we want the other counts, although now we get into the comment, which is the replies. So we will have replyCount and then keep scrolling on down. And we will have the repostCount, which, what do we call that? repostCount. I think it is. We can easily check.
which, what do we call that? repostCount. I think it is. We can easily check. It's not like that's hard to do. Yes, repostCount. So there we have that. Now we just need the content really. And did I pass the content? I passed the content. So let's scroll on up. We have the comment, we have the, like we have the action buttons, there's the content right there. It's that <p> element.
there's the content right there. It's that P element. So we're just gonna take that out and we will replace it with the item content. Although I did a raw output, didn't I? So we'll do the same thing here. And I think that should get us, because we have everything else, I think. So we have the likeCount, replyCount, postCount. Uh, we need the content. So let's have content
So we have the like count, reply count, post accounts. Uh, we need the content. So let's have content that will be simply that HTML doesn't need to be a here doc in this case. But then we do have the what postedAt dateTime, which that was I believe, one hour. So we'll change that one hour. Hopefully everything should work at least as far as the feed is concerned. We need to copy the replies here so
Verifying Feed and Profile7:50
as the feed is concerned. We need to copy the replies here so that we can paste it down here so that we can view it inside of the profile view. But I think, I think this is gonna get us, so if we take a look in the browser, it looks like everything is there as it should be. And I'm just going based upon the counts because these are the counts that we used. The content is pulling in. So that looks fine.
because these are the counts that we used. The content is pulling in. So that looks fine. If we take a look at the profile, I need to not be in the habit of controlling S because I save everything it seems. If we scroll on down, sure enough, same thing. We have our reply, all of the information is being pulled correctly. We have the correct counts. So that's great. But of course, before we do anything,
Committing and Next Steps8:31
We have the correct counts. So that's great. But of course, before we do anything, we need to commit these changes. So what did we do? We fixed assets and extracted replies. I guess we probably should have done that in two separate commits, but oh, well it is what it is. We'll commit that. And so now I think we are ready to start the really fun stuff, you know, like creating the models, seeding our database.
to start the really fun stuff, you know, like creating the models, seeding our database and implementing the logic to make all of this work.
