php - How can I hook into the return values of either Model->all() or Model->get() in Laravel 4? -


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); }   

use eloquent accessors

class venuetype extends eloquent { protected $table = "venue_types";     public function getaddressattribute($value)     {         return ucwords($value);     }  }