statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 71 forks source link

Feature/add protect to entry model #278

Closed JelleGroenendal closed 2 months ago

JelleGroenendal commented 2 months ago

We wanted to use the protect feature that the MD files have but this doesn't work by default in the Eloquent solution. With these changes it does work.

ryanmitchell commented 2 months ago

Thanks! I'd probably be inclined to just use the data column for it, much like how blueprint works. Saves a migration?

If you want to continue with the migration thats fine, but it would need an update script and the base migration would need updated (currently your update migration doesn't run).

JelleGroenendal commented 2 months ago

I agree on that. I moved this way considering this is how the MD files work. I removed the migration and updated the model to use data protect

ryanmitchell commented 2 months ago

Can you supply a test for this where it doesn't work without this change? For me adding protect to the data column already works without this change.

JelleGroenendal commented 2 months ago

Your correct i cant believe i missed that it already worked with the data field