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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners