Category: Laravel, Laravel, MySQL, MySQL

Let me demonstrate how simple it is to get a flat-file `User` model going in your Laravel application. The main idea is that all of your content and data is stored inside of a "content" file but can still be used through a normal Eloquent Model, just like it would with a MySQL or Postgres database.

This can be added to your Model class like this: This is all you need to do for the model to be "usable", but for it to function like a normal User, there are a couple of extra steps.

This is what Orbit will use to determine what content is available in your flat-files and what should be accessible from the model.

To do this in Orbit, all you need to do is change the $primaryKey or overwrite the getKeyName method.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners