For example a model has a lot of attributes, but in select I specify only a few.
$listings = Realty::select('city', 'mls', 'class_id')->get();
How to make a trait (prefebable) or class inherits Eloquent which will throw exception if I try to access attribute which was not in select:
$propertyType = $listings[0]->property_type; // returns `null`, but I need
// RuntimeException or ErrorException
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire