لاراول

مشارکت عمومی

Hands On: Community Contributions

In this mini-series, we'll, from scratch, allow users to register, submit community articles and tutorials, and then vote on their favorites. Exactly like what we have here at Laracasts! While there are a number of moving parts, it should all make perfect sense, once we're done.

سطح متوسط 13 جلسه آموزشی 02:19:00 ساعت
01
قسمت 1

Database Structure

To begin, we'll need to setup our initial database structure. This way, we can store community links, and associate them with any number of channels/categories. While we're here, we'll also set up a quick registration system. Luckily, because we have...

02
قسمت 2

Display Community Links

Let's figure out how to render a list of community links on the page. This will require us to prepare some dummy data using database factories.

03
قسمت 3

Contribute a Link: Part 1

Our next step is to add a form to the page, which allows a logged-in user to contribute any link to the list.

04
قسمت 4

Contribute a Link: Part 2

We're not quite done with the contribution form just yet. Let's write some validation code, and display the errors in the form.

05
قسمت 5

Channels

Up until now, we've used placeholders for anything related to the assigned channel for each community link. Let's fix that in this lesson. We'll need to populate the channels table, display them within a select element, and then update our validation...

06
قسمت 6

Trusted Users and Approved Links

We initially decided that all submitted links should be approved; however, that's not reflected anywhere on the site just yet. Let's update our code, so that it only fetches approved links. Next, we'll update the users table to add a new trusted colu...

07
قسمت 7

Flash Messaging and Modals

In the last video, we realized that some form of flash messaging will be needed. Let's tackle that in this lesson. While Laravel offer session flashing out of the box, we'll pull in a small little package to expedite the whole process. This will also...

08
قسمت 8

Form Objects and Touching Timestamps

How should we handle the situation where a person attempts to submit a link that has been previously shared by somebody else? Rather than allowing or preventing duplicate links entirely, let's instead touch the timestamps of the old submission. That...

09
قسمت 9

Pagination and Channel Filtering

We'll tackle two things in this lesson. First, we'll clean our views up a bit and render the proper pagination links. Next, we'll figure out how to sort all of the links, according to their category. This will allow for easy filtering.

10
قسمت 10

Voting: Part 1

We're making good progress, but we haven't yet begun working on the voting functionality. This is what allows users to vote on articles that they like. It'll take a couple lessons to knock out, but let's get started with the basic structure.

11
قسمت 11

Voting: Part 2

We're still working on the voting functionality, so let's get back into it in this lesson. We'll set up the necessary endpoints, create a form, and then refactor our existing logic just a bit.

12
قسمت 12

Sort By Popularity

Let's update our query to allow for sorting the results by the votes relationship count. As you'll see, we'll need to expand our main Eloquent query quite a bit. We'll even extract it to its own dedicated query object.

13
قسمت 13

Most Recent or Most Popular

We now have the ability to sort according to popularity, so the only remaining step is to offer the user tabs to switch between sorting options. While we're here, we'll also refactor our initial database query a bit. View the source code for this se...

دوره در حال اجرا

این دوره هنوز به پایان نرسیده است و در آینده درس های دیگری به آن افزوده خواهد شد.