So let's just say I have a date_of_birth field in my table. I want both date of birth and the derived value of age to be in my API response. my initial thought was to have a user model method return a derived value
my abstract idea is something like this:
<?php
class User extends Authenticatable implements JWTSubject
{
...
protected $show = ['age']
public function age(){
// show age function
}
...
}
is this possible if not is there a better way ?