http://laravel.com/docs/eloquent#accessors-and-mutators
I think this is one way to do it? Grab your attribute name, and then typecast the return value, or do some logic to change the output.
It's actually very simple. Say you have a column named 'status' in your table. In your model, add this method:
public function getStatusAttribute($status)
{
return (bool) $status;
}
Ehesp has provided the URL for the docs.
Thanks for the responses!
Casting in the getters worked for me.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community