Tags

Tags help you to organise listings.

You can create, edit or delete tags from the dashboard. These tags can be assigned to a listing once created.

The Tag Object

The tag object that is accessed via Eloquent queries provides a variety of useful methods for inspecting the tag's attributes and relationships:

// Get all of the tag's listings...
$tag->listings : Illuminate\Database\Eloquent\Collection

Actions

The logic executed to satisfy tag management requests can be found within action classes.

Tag Creation

The Marketplaceful\Actions\CreateTag action class is responsible for validating the input and creating the tag. This action receives the currently authenticated $user and an array of $input containing all input from the incoming request.

// Validate and create a new tag...
$tag = (new Marketplaceful\Actions\CreateTag)->create($user, $input);

Tag Update

The Marketplaceful\Actions\UpdateTag action class is responsible for validating the input and updating the tag. This action receives the currently authenticated $user, an array of $input containing all input from the incoming request, and a Marketplaceful\Models\Tag instance.

// Validate and update the given tag...
(new Marketplaceful\Actions\UpdateTag)->update($user, $tag, $input);

Tag Deletion

The Marketplaceful\Actions\DeleteTag action class is responsible for validating the input and deleting the tag. This action receives the currently authenticated $user and a Marketplaceful\Models\Tag instance.

// Delete the given tag...
(new Marketplaceful\Actions\DeleteTag)->delete($user, $team);