false, 'status' => true, ]; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'firstname', 'lastname', 'email', 'uuid', 'profile', 'status', 'is_admin', 'password', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'is_admin' => 'boolean', 'status' => 'boolean', 'password' => 'hashed', ]; public static function boot(): void { parent::boot(); // These will only ever get created by the api/bot. // If we want to add something like by whom later on, // we can just append it to the content e.g auth()?->user()?->id ?? 'API'. self::created(function ($model) { Log::create([ 'user_id' => $model->id, 'content' => 'User created.' ]); }); } }