Can I have a Laravel Model without a database table?

  eloquent, laravel, php

I would like to have a Laravel Model with all of the features and functions of a Laravel Model, but the data for the model is completely static and will never change. I could create a database table for it, but that leaves the possibility of someone modifying the table directly.

For example:

    //  Model Data for Log Levels
    name      | icon                | color
    Emergency | fas fa-ambulance    | red
    Alert     | fas fa-bullhorn     | yellow
    Critical  | fas fa-heartbeast   | orange

This would be the data, stored in the model file the same as if it was a DB table, but can never be changed. Is this possible?

Source: Laravel

Leave a Reply