Using Twill with existing Eloquent models
# ❓questions
m
So I might misunderstand how this works but I just installed Twill yesterday so I'm still figuring things out. I already have models views and controllers for a content type in this case "Games" from before I installed Twill. Do I have to create separate Models and controllers for if I want to use Twill CMS for this content type or do I need to refactor/integrate twill in the existing ones? I tried googling this but so far no concrete answer
i
Hi @MiRoDev you can definitely hook Twill on your existing models. You'll need to extend Twill's model, use fillables, use the Twill traits depending on the features you need, etc... You will probably need to add some columns to your model table, like
deleted_at
and
published
. If you're enabling slugs, translations or revisions, you'll need their model and tables too. I'd recommend generating a dummy Twill module to understand what you need in your existing models
2 Views