$input * * @throws ValidationException */ public function create(User $user, array $input): SshKey { $key = new SshKey([ 'user_id' => $user->id, 'name' => $input['name'], 'public_key' => $input['public_key'], ]); $key->save(); return $key; } /** * @return array */ public static function rules(): array { return [ 'name' => 'required', 'public_key' => [ 'required', new SshKeyRule, ], ]; } }