@RobertBaelde On your model implement this:
class YourClass extends Model
{
protected $dates = ["created_at","updated_at","certain_date"]; //add this and the certain_date attribute will be a carbon instance
protected $appends = ["certain_date"];//add this to append the certain_date accessor, so anytime you query this model this attribute will be fetched (or calculated)
public function getCertainDateAttribute()
{
//implent this method to return the difference you need
//for example, return the difference between created timestamp and now
$now = Carbon::now();
return $this->created_at->diffInDays($now);
}
}
Then you can use the "certain_date" attribute as you would use the created_at
I didn't test the code, but the overall idea should work.
Good luck!