laravel set appends
snippet in php

laravel set appends

user7762

return $user->append('is_admin')->toArray();

return $user->setAppends(['is_admin'])->toArray();