Create a Custom Entity

Goals:

  • Create a Custom Entity
  • Add Properties of types: TEXT, NUMBER, DATE, BOOLEAN, ENTITY, MEDIA, and SELECT
  • Add a Entity Rows with the Autogenerated Views and Forms

Steps

💿 Go to the /admin/entities page.

Entities

💿 Click on the New button.

💿 Create a Proyect entity with the following values:

  • Name: project
  • Slug: projects
  • Title: Project
  • Plural: Projects
  • Prefix: PRO

💿 Click on the Save button.

You'll be redirected to the /admin/entities/projects/properties route.

💿 Add a "Name" Property of type "Text":

Project Properties

💿 Now let's create the Task entity, with the following values:

  • Name: task
  • Slug: tasks
  • Title: Task
  • Plural: Tasks
  • Prefix: TSK

💿 Let's grab an icon, go to icons8, pick an icon, click download, and copy the URL:

You can use this URL: https://img.icons8.com/color/48/000000/task--v1.png.

Icon

💿 Paste the URL in the Icon field:

Task Entity

💿 Click on the Save button, and add the following properties:

NameTitleTypeDescription
project ProjectEntitySelect the Project entity
order OrderInt
name NameString
dueDate Due DateDateTime
priority PrioritySelectLow, Medium, High
completed CompletedBoolean
attachments AttachmentsMediaFor PDF's or images
subtask SubtaskStringClick 'Show advanced options' and check 'Is detail'

You should have the following properties:

Task Properties

💿 Go to /app/acme-corp-1/projects/new and create a project Project 1.

Project 1

💿 Now go to /app/acme-corp-1/tasks/new, and create the following task:

Task 1

You will be redirected to the Task Details autogenerated view:

NOTE

You can edit or delete the task.

WARNING

Currently, there's a bug on v0.2.6 that deletes the entity row audit logs when deleting the row.
Task Details

💿 Finally go to /app/acme-corp-1/settings/audit-trails to view the Project and Task logs:

Project and Task logs

I hope this quick guide was useful! Let me know if you have any question.

cookies.titleSmall

cookies.descriptionSmall shared.learnMore.