let's have following model:
// model - basic class venuetype extends eloquent { protected $table = "venue_types"; } // database table int id, varchar(255) name, varchar(255) address
from controller, run this:
// controller $results = venuetype::all();
is there anyway, within model, filter/hook (i'm hesitant filter, because of it's meaning in laravel) values. example, add title case function address (ucwords
).
// model public function hookaddress(value) { return ucwords(value); }
class venuetype extends eloquent { protected $table = "venue_types"; public function getaddressattribute($value) { return ucwords($value); } }